From 19ecc3061abb3c7d88b88015945a118bc2336c32 Mon Sep 17 00:00:00 2001 From: Nikolai Ovtsinnikov Date: Thu, 24 Oct 2024 11:27:58 +0300 Subject: [PATCH] push docker containers to GHCR too --- .github/workflows/docker-latest.yml | 61 +++++++++++++++++------------ .github/workflows/release.yaml | 3 ++ 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docker-latest.yml b/.github/workflows/docker-latest.yml index 2ff27c0e..aaa16d58 100644 --- a/.github/workflows/docker-latest.yml +++ b/.github/workflows/docker-latest.yml @@ -4,33 +4,42 @@ on: branches: - master jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - with: - platforms: 'arm64,arm' + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: 'arm64,arm' - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - with: - platforms: linux/arm64,linux/amd64,linux/arm/v7 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + with: + platforms: linux/arm64,linux/amd64,linux/arm/v7 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - platforms: ${{ steps.buildx.outputs.platforms }} - push: true - tags: ${{ github.repository }}:latest + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: ${{ steps.buildx.outputs.platforms }} + push: true + tags: | + ${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:latest diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 418a7c59..b1d0102c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -84,3 +84,6 @@ jobs: ${{ github.repository }}:${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}}.${{needs.release_please.outputs.patch}} ${{ github.repository }}:${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}} ${{ github.repository }}:${{needs.release_please.outputs.major}} + ghcr.io/${{ github.repository }}:${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}}.${{needs.release_please.outputs.patch}} + ghcr.io/${{ github.repository }}:${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}} + ghcr.io/${{ github.repository }}:${{needs.release_please.outputs.major}}