Skip to content

Docker Build

Docker Build #49

---
name: Docker Build
on:
push:
branches:
- 'main'
paths:
- 'Dockerfile'
- '.github/workflows/call-docker-build.yaml'
- 'docker-entrypoint.sh'
pull_request:
paths:
- 'Dockerfile'
- '.github/workflows/call-docker-build.yaml'
- 'docker-entrypoint.sh'
schedule:
# re-run montly to keep image fresh with upstream base images
- cron: '0 12 15 * *'
jobs:
build-jekyll-image:
# use Reusable Workflows
# https://docs.github.com/en/actions/learn-github-actions/reusing-workflows
name: Call Docker Build Jekyll
uses: bretfisher/docker-build-workflow/.github/workflows/reusable-docker-build.yaml@main
permissions:
contents: read
packages: write # needed to push docker image to ghcr.io
pull-requests: write # needed to create and update comments in PRs
secrets:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
with:
dockerhub-enable: true
ghcr-enable: true
image-names: |
bretfisher/jekyll
ghcr.io/bretfisher/jekyll
platforms: linux/amd64,linux/arm64,linux/arm/v7
target: jekyll
build-jekyll-serve-image:
# use Reusable Workflows
# https://docs.github.com/en/actions/learn-github-actions/reusing-workflows
name: Call Docker Build Jekyll-Serve
uses: bretfisher/docker-build-workflow/.github/workflows/reusable-docker-build.yaml@main
needs: build-jekyll-image
# if: github.event_name == 'push'
permissions:
contents: read
packages: write # needed to push docker image to ghcr.io
pull-requests: write # needed to create and update comments in PRs
secrets:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
with:
dockerhub-enable: true
ghcr-enable: true
image-names: |
bretfisher/jekyll-serve
ghcr.io/bretfisher/jekyll-serve
platforms: linux/amd64,linux/arm64,linux/arm/v7
target: jekyll-serve