Skip to content

Commit

Permalink
fix: split deployment job and give it write permission
Browse files Browse the repository at this point in the history
  • Loading branch information
Saransh-cpp committed Aug 14, 2024
1 parent 3a07da1 commit b71f5d1
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build_site.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: Build website
name: Build and deploy website
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
Build-website:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -51,10 +53,20 @@ jobs:
uses: actions/upload-pages-artifact@v3
with:
path: _site

deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
if: >
success()
&& github.ref == 'refs/heads/main'
github.ref == 'refs/heads/main'
&& github.repository == 'UCL/rsd-engineeringcourse'
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit b71f5d1

Please sign in to comment.