ci: share image and release actions
This commit is contained in:
1 parent
8dc7ad3d90
commit
b76d612d55
4 files changed
+140
-114
No files matched your search
@@ -6,7 +6,7 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
actions: read
|
||||
|
||||
env:
|
||||
@@ -40,36 +40,25 @@ jobs:
|
||||
echo 'Changes found; development release will run.'
|
||||
fi
|
||||
|
||||
image:
|
||||
publish:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.changed == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7.0.1
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4.4.1
|
||||
|
||||
- name: Log in to registry
|
||||
env:
|
||||
REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
||||
run: printf '%s' "$REGISTRY_PASSWORD" | docker login "$REGISTRY" --username "$REGISTRY_USERNAME" --password-stdin
|
||||
|
||||
- name: Build and push development image
|
||||
uses: docker/build-push-action@v7.4.0
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
provenance: false
|
||||
build-args: |
|
||||
APP_VERSION=${{ gitea.sha }}
|
||||
VCS_REF=${{ gitea.sha }}
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:PreRelease
|
||||
labels: |
|
||||
org.opencontainers.image.version=${{ gitea.sha }}
|
||||
org.opencontainers.image.revision=${{ gitea.sha }}
|
||||
org.opencontainers.image.source=${{ gitea.repositoryUrl }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Publish Docker image
|
||||
uses: ./.gitea/actions/publish-image
|
||||
with:
|
||||
tag: dev
|
||||
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Create Gitea prerelease
|
||||
uses: ./.gitea/actions/create-release
|
||||
with:
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
prerelease: 'true'
|
||||
Reference in new issue
Block a user