remove token_check, use github_token and add annotations to docker workflows

Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith 2025-06-03 20:22:14 +01:00
parent 6f5f5325f8
commit cd30e13ad7

View File

@ -11,23 +11,9 @@ env:
IMAGE_NAME: ${{ github.repository }}
jobs:
check-token:
runs-on: ubuntu-latest
outputs:
token_defined: ${{ steps.token_check.outputs.token_defined }}
steps:
- name: Check token
id: token_check
env:
MY_TOKEN: ${{ secrets.MY_TOKEN }}
if: "${{ env.MY_TOKEN != '' }}"
run: echo "token_defined=true" >> "$GITHUB_OUTPUT"
build:
name: Release
runs-on: ubuntu-latest
needs: [check-token]
if: needs.check-token.outputs.token_defined == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
@ -47,13 +33,15 @@ jobs:
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.MY_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
- name: Build and push Docker image
uses: docker/build-push-action@v6
@ -64,6 +52,7 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
build-args: |
INCLUDE_MONGODB_TOOLS=true
INCLUDE_POSTGRESQL_TOOLS=true