Skip to content

Commit 36602f5

Browse files
use artifacts instead of repo checkout
1 parent 85debd4 commit 36602f5

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,23 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21+
test: # todo: remove this
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Create simple file
25+
run: echo "Hello, world!" > hello.txt
26+
27+
- name: Upload artifact
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: hello
31+
path: hello.txt
32+
2133
call-jekyll-build:
34+
needs: test # todo: remove this
2235
uses: ./.github/workflows/jekyll-build.yml
2336
with:
24-
site_source: '.'
37+
site_artifact: hello # todo: remove this
2538
target_branch: gh-pages
2639
clean_gh_pages: true
2740
secrets:

.github/workflows/jekyll-build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ name: Build Jekyll
44
on:
55
workflow_call:
66
inputs:
7-
site_source:
8-
description: 'Directory where the site source files are located'
7+
site_artifact:
8+
description: 'Artifact name to download'
99
required: false
10-
default: '.'
10+
default: ''
1111
type: string
1212
config_file:
1313
description: 'Configuration file to use, relative to the site source directory'
@@ -54,9 +54,10 @@ jobs:
5454
path: theme
5555

5656
- name: Checkout project
57-
if: ${{ github.repository != 'LizardByte/LizardByte.github.io' }}
58-
uses: actions/checkout@v4
57+
if: ${{ inputs.site_artifact != '' }}
58+
uses: actions/download-artifact@v4
5959
with:
60+
name: ${{ inputs.site_artifact }}
6061
path: project
6162

6263
- name: Setup project
@@ -102,7 +103,7 @@ jobs:
102103
done
103104
104105
# copy project directory, they should only come from the project repo
105-
cp -RTf ./project/${{ inputs.site_source }}/ ${TMPDIR}/
106+
cp -RTf ./project/ ${TMPDIR}/
106107
107108
# remove the workspace
108109
cd ..

0 commit comments

Comments
 (0)