mirror of
https://github.com/hendricius/the-sourdough-framework
synced 2025-12-07 01:54:26 -06:00
Simplify build process (#352)
Related to #349. This only builds the docker image on push to main. For pull requests and pushes the whole build is tested.
This commit is contained in:
committed by
GitHub
parent
2f385a82b7
commit
d1b0bbead1
29
.github/workflows/release-book-website.yml
vendored
29
.github/workflows/release-book-website.yml
vendored
@@ -4,12 +4,37 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
IMAGE: ghcr.io/${{ github.repository }}:latest
|
||||
LATEST_IMAGE: ghcr.io/${{ github.repository }}:latest
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
uses: ./.github/workflows/docker-build-push.yml
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Buildx for caching
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ghcr.io/${{ github.repository }}:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
|
||||
release-book-website:
|
||||
needs: build-and-push-image
|
||||
|
||||
Reference in New Issue
Block a user