diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e272a0f..79ecf47 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -48,46 +48,46 @@ jobs: --build-arg branch_name=$BRANCH_NAME \ . --file Dockerfile fi -# -# -# # Push image to GitHub Packages. -# # See also https://docs.docker.com/docker-hub/builds/ -# push: -# # Ensure test job passes before pushing image. -# needs: test -# -# runs-on: ubuntu-latest -# if: github.event_name == 'push' -# -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# -# - name: Docker meta -# id: meta -# uses: docker/metadata-action@v4 -# with: -# # list of Docker images to use as base name for tags -# images: | -# ghcr.io/biliup/caution -# - name: Set up QEMU -# uses: docker/setup-qemu-action@v2 -# -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v2 -# -# - name: Login to DockerHub -# uses: docker/login-action@v2 -# with: -# registry: ghcr.io -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} -# -# - name: Build and push -# uses: docker/build-push-action@v3 -# with: -# context: . -# platforms: linux/amd64,linux/arm64 -# push: true -# tags: ${{ steps.meta.outputs.tags }} -# labels: ${{ steps.meta.outputs.labels }} + + + # Push image to GitHub Packages. + # See also https://docs.docker.com/docker-hub/builds/ + push: + # Ensure test job passes before pushing image. + needs: test + + runs-on: ubuntu-latest + if: github.event_name == 'push' + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/biliup/caution + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}