Skip to content

Commit

Permalink
🔧 Fix docker deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Nov 13, 2023
1 parent 83d0934 commit d88203d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
49 changes: 27 additions & 22 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
1 change: 0 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d88203d

Please sign in to comment.