Skip to content

Commit

Permalink
try skipping base image build if it already exists; remove hugo from …
Browse files Browse the repository at this point in the history
…base image
  • Loading branch information
aine-etke committed Sep 11, 2024
1 parent 6a9e101 commit b898d35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ jobs:
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Check if Docker image exists
id: check
run: |
IMAGE_TAG=ghcr.io/${{ github.repository }}/base:${{ env.alpine }}-${{ env.ansible_core }}-${{ env.ansible }}
if docker manifest inspect $IMAGE_TAG > /dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
- name: Login to ghcr.io
if: ${{ steps.check.outputs.exists != 'true' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -33,6 +42,7 @@ jobs:
tags: |
type=raw,value=${{ env.alpine }}-${{ env.ansible_core }}-${{ env.ansible }},enable=${{ github.ref_name == 'fresh' }}
- name: Build and push
if: ${{ steps.check.outputs.exists != 'true' }}
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG ANSIBLE_CORE
ENV PATH="/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin"

RUN apk --no-cache add python3 py3-cryptography py3-jinja2 py3-packaging py3-paramiko py3-resolvelib py3-passlib py3-yaml \
git openssh hugo && \
git openssh && \
apk --no-cache add --virtual builddeps alpine-sdk py3-pip && \
ln -s /bin/uname /usr/local/bin/uname && \
ln -s /bin/rm /usr/local/bin/rm && \
Expand Down

0 comments on commit b898d35

Please sign in to comment.