diff --git a/.github/workflows/publish-experimental.yml b/.github/workflows/publish-experimental.yml index 5a28a5d4d..d89e51881 100644 --- a/.github/workflows/publish-experimental.yml +++ b/.github/workflows/publish-experimental.yml @@ -17,10 +17,18 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE_REPOSITORY }} + tags: | + type=raw,value=experimental - name: Build and push Docker image uses: docker/build-push-action@v6 with: platforms: linux/amd64 pull: true push: true - tags: ${{ env.IMAGE_REPOSITORY }}:experimental + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/publish-latest-to-ghcr.yml b/.github/workflows/publish-latest-to-ghcr.yml deleted file mode 100644 index 6760074e5..000000000 --- a/.github/workflows/publish-latest-to-ghcr.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: publish-latest-to-ghcr -on: - workflow_run: - workflows: [test] - branches: [master] - types: [completed] -concurrency: - group: ${{ github.event.workflow_run.head_repository.full_name }}::${{ github.event.workflow_run.head_branch }}::${{ github.workflow }} - cancel-in-progress: true -jobs: - publish-latest-to-ghcr: - runs-on: ubuntu-latest - if: ${{ (github.event.workflow_run.conclusion == 'success') && (github.event.workflow_run.head_repository.full_name == github.repository) }} - permissions: - contents: read - packages: write - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Get image repository - run: echo IMAGE_REPOSITORY=$(echo ghcr.io/${{ github.actor }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV - - name: Login to Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - platforms: linux/amd64,linux/arm/v7,linux/arm64 - pull: true - push: true - tags: ${{ env.IMAGE_REPOSITORY }}:latest diff --git a/.github/workflows/publish-latest.yml b/.github/workflows/publish-latest.yml index 22c86cc31..fe5c421a7 100644 --- a/.github/workflows/publish-latest.yml +++ b/.github/workflows/publish-latest.yml @@ -19,16 +19,34 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Get image repository - run: echo IMAGE_REPOSITORY=$(echo ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + run: | + echo DOCKER_IMAGE_REPOSITORY=$(echo ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + echo GHCR_IMAGE_REPOSITORY=$(echo ghcr.io/${{ github.actor }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV - name: Login to Docker Registry uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.DOCKER_IMAGE_REPOSITORY }} + ${{ env.GHCR_IMAGE_REPOSITORY }} + tags: | + type=raw,value=latest - name: Build and push Docker image uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm/v7,linux/arm64 pull: true push: true - tags: ${{ env.IMAGE_REPOSITORY }}:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/publish-release-to-ghcr.yml b/.github/workflows/publish-release-to-ghcr.yml deleted file mode 100644 index da5873c8c..000000000 --- a/.github/workflows/publish-release-to-ghcr.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: publish-release-to-ghcr -on: - release: - types: [published] -jobs: - publish-release-to-ghcr: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Get image repository - run: echo IMAGE_REPOSITORY=$(echo ghcr.io/${{ github.actor }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV - - name: Get the release - run: echo RELEASE=${GITHUB_REF/refs\/tags\//} >> $GITHUB_ENV - - name: Login to Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - platforms: linux/amd64,linux/arm/v7,linux/arm64 - pull: true - push: true - tags: | - ${{ env.IMAGE_REPOSITORY }}:${{ env.RELEASE }} - ${{ env.IMAGE_REPOSITORY }}:stable - ${{ env.IMAGE_REPOSITORY }}:latest diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index d12b90653..159204412 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -14,7 +14,9 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Get image repository - run: echo IMAGE_REPOSITORY=$(echo ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + run: | + echo DOCKER_IMAGE_REPOSITORY=$(echo ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + echo GHCR_IMAGE_REPOSITORY=$(echo ghcr.io/${{ github.actor }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV - name: Get the release run: echo RELEASE=${GITHUB_REF/refs\/tags\//} >> $GITHUB_ENV - name: Login to Docker Registry @@ -22,13 +24,28 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.DOCKER_IMAGE_REPOSITORY }} + ${{ env.GHCR_IMAGE_REPOSITORY }} + tags: | + type=raw,value=${{ env.RELEASE }} + type=raw,value=stable + type=raw,value=latest - name: Build and push Docker image uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm/v7,linux/arm64 pull: true push: true - tags: | - ${{ env.IMAGE_REPOSITORY }}:${{ env.RELEASE }} - ${{ env.IMAGE_REPOSITORY }}:stable - ${{ env.IMAGE_REPOSITORY }}:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}