Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e2e676d

Browse files
committed
Build the image in the same pipeline as the font
1 parent c209a4d commit e2e676d

1 file changed

Lines changed: 5 additions & 29 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,61 +7,37 @@ on:
77
branches: [master]
88

99
jobs:
10-
build-image:
10+
build:
1111
runs-on: ubuntu-latest
1212
permissions:
1313
contents: read
1414
packages: write
15-
outputs:
16-
image: ${{ steps.image.outputs.image }}
1715
steps:
1816
- uses: actions/checkout@v4
1917

20-
- name: Check if Dockerfile changed
21-
id: filter
22-
uses: dorny/paths-filter@v3
23-
with:
24-
filters: |
25-
dockerfile:
26-
- 'xkcd-script/generator/Dockerfile'
27-
2818
- name: Log in to GitHub Container Registry
29-
if: steps.filter.outputs.dockerfile == 'true' && github.event_name == 'push'
19+
if: github.event_name == 'push'
3020
uses: docker/login-action@v3
3121
with:
3222
registry: ghcr.io
3323
username: ${{ github.actor }}
3424
password: ${{ secrets.GITHUB_TOKEN }}
3525

3626
- name: Set up Docker Buildx
37-
if: steps.filter.outputs.dockerfile == 'true'
3827
uses: docker/setup-buildx-action@v3
3928

4029
- name: Build (and push on master) Docker image
41-
if: steps.filter.outputs.dockerfile == 'true'
4230
uses: docker/build-push-action@v6
4331
with:
4432
context: xkcd-script/generator
33+
load: true
4534
push: ${{ github.event_name == 'push' }}
4635
tags: ghcr.io/ipython/xkcd-font:fontbuilder
4736
cache-from: type=gha
4837
cache-to: type=gha,mode=max
4938

50-
- name: Set image name
51-
id: image
52-
run: echo "image=ghcr.io/ipython/xkcd-font:fontbuilder" >> "$GITHUB_OUTPUT"
53-
54-
build-font:
55-
runs-on: ubuntu-latest
56-
needs: build-image
57-
steps:
58-
- uses: actions/checkout@v4
59-
60-
- name: Pull font builder image
61-
run: docker pull ${{ needs.build-image.outputs.image }}
62-
6339
- name: Generate font
64-
run: FONTBUILDER_IMAGE=${{ needs.build-image.outputs.image }} xkcd-script/generator/run.sh
40+
run: FONTBUILDER_IMAGE=ghcr.io/ipython/xkcd-font:fontbuilder xkcd-script/generator/run.sh
6541

6642
- name: Generate samples
6743
run: xkcd-script/samples/preview.sh
@@ -81,7 +57,7 @@ jobs:
8157
8258
- name: Check generated files match committed files
8359
run: |
84-
git diff --exit-code xkcd-script/font/ xkcd-script/samples/ || {
60+
git diff --exit-code xkcd-script/font/xkcd-script.otf xkcd-script/font/xkcd-script.ttf xkcd-script/font/xkcd-script.woff xkcd-script/samples/ || {
8561
echo ""
8662
echo "Generated files differ from committed files."
8763
echo "Download the 'xkcd-script-font' artifact from this run and commit the updated files."

0 commit comments

Comments
 (0)