Skip to content

Commit e83b4d5

Browse files
Update build-and-deploy-pages.yml
1 parent 86e3c7b commit e83b4d5

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

.github/workflows/build-and-deploy-pages.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,36 @@ on:
77
branches: [ "master" ]
88

99
jobs:
10+
# Build job
1011
build:
12+
# Specify runner + build & upload the static files as an artifact
1113
runs-on: ubuntu-latest
14+
steps:
15+
- name: Build static files
16+
id: build
17+
run: |
18+
docker run \
19+
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
20+
jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future"
21+
22+
- name: Upload static files as artifact
23+
id: deployment
24+
uses: actions/upload-pages-artifact@v3
25+
with:
26+
path: _site/
1227

28+
# Deployment job
29+
deploy:
30+
environment:
31+
name: github-pages
32+
url: ${{ steps.deployment.outputs.page_url }}
1333
permissions:
1434
pages: write # to deploy to Pages
1535
id-token: write # to verify the deployment originates from an appropriate source
16-
36+
runs-on: ubuntu-latest
37+
if: github.event_name == 'push'
38+
needs: build
1739
steps:
18-
- uses: actions/checkout@v4
19-
- name: Build the site in the jekyll/builder container
20-
run: |
21-
docker run \
22-
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
23-
jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future"
24-
- uses: actions/deploy-pages@v4
25-
if: github.event_name == 'push'
26-
with:
27-
# GitHub token
28-
token: ${{ github.token }}
29-
40+
- name: Deploy to GitHub Pages
41+
id: deployment
42+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)