diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93a7388..a89754c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,8 +4,8 @@ name: Docker Build & Push on: push: - tags: - - '*' + tags: + - "*" workflow_dispatch: # Allows you to run this workflow manually from the Actions tab env: @@ -17,47 +17,53 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - if: ${{ !github.event.act }} # skip during local actions testing - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Prepare - if: success() - id: prepare - run: | - echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM} - echo "::set-output name=tag::$(git describe --tags --abbrev=0)" - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ env.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to Quay Container Registry - uses: docker/login-action@v2 - with: - registry: quay.io - username: ${{ env.DOCKER_USERNAME }}+pushbot - password: ${{ secrets.QUAY_TOKEN }} - - name: Build container and Push - uses: docker/build-push-action@v3 - with: - context: . - platforms: ${{ env.DOCKER_TARGET_PLATFORM }} - push: true - tags: | - ${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }} - ${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest - ghcr.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }} - ghcr.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest - quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }} - quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest + - name: Checkout + uses: actions/checkout@v3 + if: ${{ !github.event.act }} # skip during local actions testing + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Prepare + if: success() + id: prepare + run: | + echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM} + echo "::set-output name=tag::$(git describe --tags --abbrev=0)" + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ env.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to Quay Container Registry + uses: docker/login-action@v2 + with: + registry: quay.io + username: ${{ env.DOCKER_USERNAME }}+pushbot + password: ${{ secrets.QUAY_TOKEN }} + + - name: Build container and Push + uses: docker/build-push-action@v3 + with: + context: . + platforms: ${{ env.DOCKER_TARGET_PLATFORM }} + push: true + tags: | + ${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }} + ${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest + ghcr.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }} + ghcr.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest + quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:${{ steps.prepare.outputs.tag }} + quay.io/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_CONTAINER_NAME }}:latest