From 6ff8fd0330e1dcaed153aed7dbcf39c844e6300a Mon Sep 17 00:00:00 2001 From: gfanton <8671905+gfanton@users.noreply.github.com> Date: Wed, 10 Apr 2024 18:38:39 +0200 Subject: [PATCH] chore: cleanup Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com> --- .github/workflows/docker.yml | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0df91bec743..05d47f11fa1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -20,6 +20,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Get commit SHA + id: commit + run: echo "sha=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT" + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -36,25 +40,10 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 - push: "${{ github.event_name != 'pull_request' }}" + push: ${{ github.event_name != 'pull_request' }} tags: | ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest - ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }} - - # - name: Build main Docker image - # env: - # owner: ${{ github.repository_owner }} - # reponame: ${{ github.event.repository.name }} - # platform: linux/arm64,linux/amd64 - # run: | - # docker buildx build \ - # -t ghcr.io/${owner}/${reponame} - # --platform ${platform} \ - # --tag ghcr.io/${owner}/${reponame}:latest \ - # --tag ghcr.io/${owner}/${reponame}:${GITHUB_SHA::8} \ - # . - - # docker tag ghcr.io/${owner}/${reponame}:latest ghcr.io/${owner}/${reponame}:${GITHUB_SHA::8} + ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ steps.commit.outputs.sha }} build-slim: runs-on: ubuntu-latest @@ -65,10 +54,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Get commit SHA + id: commit + run: echo "sha=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT" + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -88,4 +80,4 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: | ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.target }}:latest - ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.target }}:${{ github.sha }} + ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.target }}:${{ steps.commit.outputs.sha }}