diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b27ba5451..721d9fcea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -295,6 +295,33 @@ jobs: docker manifest push ${IMAGE}:latest fi + tags: + runs-on: ubuntu-22.04 + needs: [build, publish] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Git Config + env: + GITHUB_OWNER: ${{ github.repository_owner }} + run: | + git config --global user.email "${GITHUB_OWNER}@users.noreply.github.com" + git config --global user.name "${GITHUB_OWNER}" + + - name: Update TAGS.json + env: + VERSION: ${{ needs.build.outputs.version }} + BRANCH: ${{ needs.build.outputs.branch }} + run: | + TAGS="${GITHUB_REF//refs\/heads\//}${BRANCH},${GITHUB_REF//refs\/heads\//}${BRANCH}-${VERSION},${GITHUB_REF//refs\/heads\//}${BRANCH}-${GITHUB_SHA:0:7}" + LAST_UPDATED=$(date -u +'%FT%T.%3NZ') + jq -n --arg last_updated "${LAST_UPDATED}" --arg tags "${TAGS}" '{ last_updated: $last_updated, tags: $tags | split(",") }' > TAGS.json + git add . + if git commit -m "Update TAGS.json [skip ci]"; then + git push + fi + notify: runs-on: ubuntu-22.04 if: always()