From d88203dfcdf44c5385791ec62f35da93964468bc Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Mon, 13 Nov 2023 18:10:25 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fix=20docker=20deployment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker.yaml | 49 +++++++++++++++++++---------------- docker/Dockerfile | 1 - 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index cd375118b..5534572a1 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -12,8 +12,12 @@ on: push: tags: - '*.*.*' + pull_request: + paths: ['docker/**'] + env: NEEDS_VERSION: 2.0.0 + DEPLOY_IMAGE: ${{ github.event_name != 'pull_request' }} jobs: build: @@ -46,30 +50,31 @@ jobs: latest=true tags: | type=pep440,pattern={{version}} - - - # Check if deployment is needed (if no manual trigger was done, defaults to 'y') - name: Check if deployment is needed - id: deploycheck + + - name: Check if deployment is needed + if: github.event.inputs.deploy == 'n' run: | - DEPLOY_CHECK=${{ github.event.inputs.deploy }} - echo "::set-output name=value::${DEPLOY_CHECK:-"y"}" - - - # Login to Docker Hub Docker Registry for deployment - name: Login to Docker Hub Docker Registry 🐸 + echo "DEPLOY_IMAGE=false" >> "$GITHUB_ENV" + + - name: Print DEPLOY_IMAGE + run: | + echo "$DEPLOY_IMAGE" + + - name: Login to Docker Hub Docker Registry 🐸 uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push html image to Doker Hub Docker Registry 🐳 - id: docker_build - uses: docker/build-push-action@v5 - with: - push: ${{ github.event_name != 'pull_request' && steps.deploycheck.outputs.value == 'y' }} - file: docker/Dockerfile - platforms: linux/amd64,linux/arm64 - build-args: | - NEEDS_VERSION=${{ env.NEEDS_VERSION }} - BASE_IMAGE=${{ matrix.base-image }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }}} + + # - name: Build and push html image to Doker Hub Docker Registry 🐳 + # id: docker_build + # uses: docker/build-push-action@v5 + # with: + # push: ${{ github.event_name != 'pull_request' && env.DEPLOY_IMAGE == 'y' }} + # file: docker/Dockerfile + # platforms: linux/amd64,linux/arm64 + # build-args: | + # NEEDS_VERSION=${{ env.NEEDS_VERSION }} + # BASE_IMAGE=${{ matrix.base-image }} + # tags: ${{ steps.meta.outputs.tags }} + # labels: ${{ steps.meta.outputs.labels }} diff --git a/docker/Dockerfile b/docker/Dockerfile index 36078bf25..0dab808c7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -14,7 +14,6 @@ ARG DEBIAN_FRONTEND=noninteractive # Install apt & make RUN \ - sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends sudo