Skip to content

fix: prevent deploy action running on forks (#9) #24

fix: prevent deploy action running on forks (#9)

fix: prevent deploy action running on forks (#9) #24

Workflow file for this run

name: Deploy Eleventy
on:
push:
branches:
- main
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
if: github.repository == 'linuxunsw/wiki'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Build site
run: npm run build
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./_site
deploy:
if: github.repository == 'linuxunsw/wiki'
needs: build
runs-on: ubuntu-22.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4