Skip to content

Commit 498808b

Browse files
authored
Merge pull request #33 from actions/record
Fix up record action
2 parents 38b0448 + 0b99ed0 commit 498808b

File tree

1 file changed

+48
-49
lines changed

1 file changed

+48
-49
lines changed

.github/workflows/record.yml

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,65 @@ name: Record Expected
33
on:
44
workflow_dispatch:
55

6+
env:
7+
# Use docker.io for Docker Hub if empty
8+
REGISTRY: ghcr.io
9+
# github.repository as <account>/<repo>
10+
IMAGE_NAME: ${{ github.repository }}
11+
612
jobs:
7-
record-expected-output:
13+
resolve-image-tag:
814
runs-on: ubuntu-latest
15+
outputs:
16+
tag: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}
917
steps:
1018
- name: Checkout repository
1119
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: ./
20+
- name: Grep action.yaml content
21+
id: grep-image-content
22+
run: |
23+
image=$(grep -E "jekyll-build-pages.*\'" action.yml)
24+
echo "::set-output name=image::$image"
25+
- uses: actions-ecosystem/action-regex-match@v2
26+
id: regex-match
2227
with:
23-
source: test_projects/readme
24-
destination: test_projects/readme/_expected
25-
build_revision: JEKYLL_BUILD_REVISION
28+
text: ${{ steps.grep-image-content.outputs.image }}
29+
regex: "jekyll-build-pages:(.*)'"
2630

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

55-
- name: Build test project 'future-false'
55+
- name: Build ${{ matrix.test }} Project
5656
uses: ./
5757
with:
58-
source: test_projects/future-false
59-
destination: test_projects/future-false/_expected
58+
source: ./test_projects/${{ matrix.test }}
59+
destination: ./test_projects/${{ matrix.test }}/_expected
6060
build_revision: JEKYLL_BUILD_REVISION
61+
token: ${{ secrets.GITHUB_TOKEN }}
6162

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

0 commit comments

Comments
 (0)