Skip to content

Commit a520830

Browse files
authored
Merge pull request #518 from canada-ca/nschonni-patch-1
ci: copy template GitHub Pages Action setup
2 parents 51a310b + 08b68b1 commit a520830

1 file changed

Lines changed: 25 additions & 10 deletions

File tree

.github/workflows/jekyll.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ on:
1616

1717
# Sets permissions of the GITHUB_TOKEN to allow pushing to gh-pages
1818
permissions:
19-
contents: write
19+
contents: read
20+
pages: write
21+
id-token: write
2022

2123
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
2224
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
@@ -25,7 +27,7 @@ concurrency:
2527
cancel-in-progress: false
2628

2729
jobs:
28-
build-and-deploy:
30+
build:
2931
runs-on: ubuntu-latest
3032
steps:
3133
- name: Checkout
@@ -38,15 +40,28 @@ jobs:
3840
bundler-cache: true
3941
cache-version: 0
4042

43+
- name: Setup Pages
44+
id: pages
45+
uses: actions/configure-pages@v5
46+
4147
- name: Build with Jekyll
42-
run: bundle exec jekyll build
48+
# Outputs to the './_site' directory by default
49+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
4350
env:
4451
JEKYLL_ENV: production
4552

46-
- name: Deploy to gh-pages
47-
uses: peaceiris/actions-gh-pages@v4
48-
with:
49-
github_token: ${{ secrets.GITHUB_TOKEN }}
50-
publish_dir: ./_site
51-
keep_files: true
52-
publish_branch: gh-pages
53+
- name: Upload artifact
54+
# Automatically uploads an artifact from the './_site' directory by default
55+
uses: actions/upload-pages-artifact@v3
56+
57+
# Deployment job
58+
deploy:
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
runs-on: ubuntu-latest
63+
needs: build
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)