From 790d88a0c0e8ef16c22c506e691304b61a672cb3 Mon Sep 17 00:00:00 2001 From: schuer Date: Sun, 17 Dec 2023 14:24:09 +0100 Subject: [PATCH] ci: workflows --- .github/workflows/generate.yml | 4 +-- .github/workflows/publish.yml | 47 ++++++++++++++++++++-------------- .github/workflows/test.yml | 4 +-- 3 files changed, 32 insertions(+), 23 deletions(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index f2591af..67e49f0 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -28,7 +28,7 @@ jobs: token: ${{ secrets.GH_WORKFLOW }} - name: Setup Deno - # https://github.com/denoland/setup-deno + # https://github.com/marketplace/actions/setup-deno uses: denoland/setup-deno@v1 with: deno-version: "^1" @@ -39,7 +39,7 @@ jobs: - name: Auto-commit changed files # Automatically commit files which have been changed during the workflow run and push changes back # to remote repository. - # https://github.com/stefanzweifel/git-auto-commit-action + # https://github.com/marketplace/actions/git-auto-commit uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "GenerRRRRR-ate image files from source!" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ca8bcfb..3cae457 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -55,48 +55,57 @@ jobs: steps: - name: Checkout repository + # https://github.com/marketplace/actions/checkout uses: actions/checkout@v4 with: persist-credentials: false - name: Set up QEMU - # https://github.com/docker/setup-qemu-action + # https://github.com/marketplace/actions/docker-setup-qemu uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - # https://github.com/docker/setup-buildx-action + # https://github.com/marketplace/actions/docker-setup-buildx uses: docker/setup-buildx-action@v3 # - name: Login to Docker Hub - # # https://github.com/docker/login-action + # # https://github.com/marketplace/actions/docker-login # uses: docker/login-action@v3 # with: # username: ${{ secrets.DOCKERHUB_USERNAME }} # password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GitHub Container Registry - # https://github.com/docker/login-action + # https://github.com/marketplace/actions/docker-login uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - # - name: Build and push - # # https://github.com/docker/build-push-action - # uses: docker/build-push-action@v5 - # with: - # context: ./images/${{ matrix.image }} - # platforms: linux/amd64,linux/arm64 - # push: true - # # tags: | - # # ${{ env.REGISTRY_IMAGE }}:${{ matrix.image }} - # # ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ matrix.image }} - # tags: | - # ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ matrix.image }} + - name: Collect tags for image + # https://github.com/marketplace/actions/yq-portable-yaml-processor + uses: mikefarah/yq@v4 + id: collect_tags + with: + cmd: yq '.tags | @csv' ./images/${{ matrix.image }}/tags.yml + + - name: Build and push + # https://github.com/marketplace/actions/build-and-push-docker-images + uses: docker/build-push-action@v5 + with: + context: ./images/${{ matrix.image }} + platforms: linux/amd64,linux/arm64 + push: true + provenance: false + # tags: | + # ${{ env.REGISTRY_IMAGE }}:${{ steps.collect_tags.outputs.result }} + # ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ steps.collect_tags.outputs.result }} + tags: | + ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ steps.collect_tags.outputs.result }} # - name: Update repo description - # # https://github.com/peter-evans/dockerhub-description + # # https://github.com/marketplace/actions/docker-hub-description # uses: peter-evans/dockerhub-description@v3 # with: # username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -106,10 +115,10 @@ jobs: # enable-url-completion: true - name: Delete untagged containers from GitHub Container Registry - # https://github.com/Chizkiyahu/delete-untagged-ghcr-action + # https://github.com/marketplace/actions/delete-untagged-ghcr uses: Chizkiyahu/delete-untagged-ghcr-action@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GH_PACKAGES }} untagged_only: true owner_type: org except_untagged_multiplatform: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1219a4..f11cdf6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout repository - # https://github.com/actions/checkout + # https://github.com/marketplace/actions/checkout uses: actions/checkout@v4 with: persist-credentials: false @@ -50,7 +50,7 @@ jobs: persist-credentials: false - name: Build and push - # https://github.com/docker/build-push-action + # https://github.com/marketplace/actions/build-and-push-docker-images uses: docker/build-push-action@v5 with: context: ./images/${{ matrix.image }}