Skip to content

Commit b71f5d1

Browse files
committed
fix: split deployment job and give it write permission
1 parent 3a07da1 commit b71f5d1

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/build_site.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
name: Build website
1+
name: Build and deploy website
22
on:
33
push:
44
branches:
55
- main
66
pull_request:
77
branches:
88
- main
9+
workflow_dispatch:
10+
911
jobs:
10-
Build-website:
12+
build:
1113
runs-on: ubuntu-latest
1214
steps:
1315
- uses: actions/checkout@v4
@@ -51,10 +53,20 @@ jobs:
5153
uses: actions/upload-pages-artifact@v3
5254
with:
5355
path: _site
56+
57+
deploy:
58+
needs: build
59+
permissions:
60+
pages: write
61+
id-token: write
62+
environment:
63+
name: github-pages
64+
url: ${{ steps.deployment.outputs.page_url }}
65+
runs-on: ubuntu-latest
66+
steps:
5467
- name: Deploy to GitHub Pages
5568
if: >
56-
success()
57-
&& github.ref == 'refs/heads/main'
69+
github.ref == 'refs/heads/main'
5870
&& github.repository == 'UCL/rsd-engineeringcourse'
5971
id: deployment
6072
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)