From 9b1d5879cc01ffeb6bd432343c1653bbd89f4f05 Mon Sep 17 00:00:00 2001 From: Thomas Leplus Date: Tue, 12 Mar 2024 19:06:57 -0600 Subject: [PATCH] Improved docker tagging --- .github/workflows/dockerhub.yml | 2 +- .github/workflows/dockerimage.yml | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 234ec09..f593c4d 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -19,4 +19,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: Pull the latest ${{ matrix.platform }} image - run: docker pull --platform ${{ matrix.platform }} leplusorg/latex + run: docker pull --platform ${{ matrix.platform }} ${{ github.repository_owner }}/latex diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index e0e14b7..57654ed 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -21,14 +21,27 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - uses: docker/metadata-action@v5 + id: meta + with: + images: ${{ github.repository_owner }}/yaml + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha - uses: docker/build-push-action@v5 with: context: latex platforms: linux/amd64,linux/arm64 pull: true - push: true + push: ${{ github.event_name != 'pull_request' }} sbom: true - tags: leplusorg/latex:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} - name: Test the Docker image working-directory: latex run: docker compose -f docker-compose.test.yml run sut