Skip to content

Commit 837d22a

Browse files
committed
Fix up record action
1 parent 38b0448 commit 837d22a

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

.github/workflows/record.yml

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,67 @@ name: Record Expected
22

33
on:
44
workflow_dispatch:
5+
pull_request:
6+
7+
env:
8+
# Use docker.io for Docker Hub if empty
9+
REGISTRY: ghcr.io
10+
# github.repository as <account>/<repo>
11+
IMAGE_NAME: ${{ github.repository }}
512

613
jobs:
7-
record-expected-output:
14+
resolve-image-tag:
815
runs-on: ubuntu-latest
16+
outputs:
17+
tag: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}
918
steps:
1019
- name: Checkout repository
1120
uses: actions/checkout@v2
12-
13-
- name: Build test project 'simple'
14-
uses: ./
15-
with:
16-
source: test_projects/simple
17-
destination: test_projects/simple/_expected
18-
build_revision: JEKYLL_BUILD_REVISION
19-
20-
- name: Build test project 'readme'
21-
uses: ./
21+
- name: Grep action.yaml content
22+
id: grep-image-content
23+
run: |
24+
image=$(grep -E "jekyll-build-pages.*\'" action.yml)
25+
echo "::set-output name=image::$image"
26+
- uses: actions-ecosystem/action-regex-match@v2
27+
id: regex-match
2228
with:
23-
source: test_projects/readme
24-
destination: test_projects/readme/_expected
25-
build_revision: JEKYLL_BUILD_REVISION
29+
text: ${{ steps.grep-image-content.outputs.image }}
30+
regex: "jekyll-build-pages:(.*)'"
2631

27-
- name: Build test project 'octicons'
28-
uses: ./
29-
with:
30-
source: test_projects/octicons
31-
destination: test_projects/octicons/_expected
32-
build_revision: JEKYLL_BUILD_REVISION
33-
34-
- name: Build test project 'mojombo'
35-
uses: ./
36-
with:
37-
source: test_projects/mojombo
38-
destination: test_projects/mojombo/_expected
39-
build_revision: JEKYLL_BUILD_REVISION
40-
41-
- name: Build test project 'themes'
42-
uses: ./
43-
with:
44-
source: test_projects/themes
45-
destination: test_projects/themes/_expected
46-
build_revision: JEKYLL_BUILD_REVISION
47-
48-
- name: Build test project 'jekyll-include-cache'
49-
uses: ./
32+
test-builds:
33+
needs: resolve-image-tag
34+
runs-on: ubuntu-latest
35+
strategy:
36+
matrix:
37+
test:
38+
- simple
39+
- readme
40+
- octicons
41+
- mojombo
42+
- themes
43+
- jekyll-include-cache
44+
- future-false
45+
- future-true
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v2
49+
- name: Build local docker image
50+
uses: docker/build-push-action@v2
5051
with:
51-
source: test_projects/jekyll-include-cache
52-
destination: test_projects/jekyll-include-cache/_expected
53-
build_revision: JEKYLL_BUILD_REVISION
52+
context: .
53+
file: Dockerfile
54+
tags: ${{ needs.resolve-image-tag.outputs.tag }}
5455

55-
- name: Build test project 'future-false'
56+
- name: Build ${{ matrix.test }} Project
5657
uses: ./
5758
with:
58-
source: test_projects/future-false
59-
destination: test_projects/future-false/_expected
59+
source: ./test_projects/${{ matrix.test }}
60+
destination: ./test_projects/${{ matrix.test }}/_expected
6061
build_revision: JEKYLL_BUILD_REVISION
62+
token: ${{ secrets.GITHUB_TOKEN }}
6163

62-
- name: Build test project 'future-true'
63-
uses: ./
64+
- name: Archive ${{ matrix.test }} Project
65+
uses: actions/upload-artifact@v3
6466
with:
65-
source: test_projects/future-true
66-
destination: test_projects/future-true/_expected
67-
build_revision: JEKYLL_BUILD_REVISION
68-
67+
name: ${{ matrix.test }}
68+
path: ./test_projects/${{ matrix.test }}/_expected

0 commit comments

Comments
 (0)