Skip to content

Commit f8c4e17

Browse files
committed
Add workflow for github pages
1 parent fe0cc2c commit f8c4e17

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy GitHub Pages
2+
run-name: Deploy "${{ github.event.head_commit.message }}" from ${{ github.actor }} 🚀
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: Setup python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: '3'
17+
- name: Setup pelican
18+
run: pip install -r requirements.txt
19+
- name: Build
20+
run: python -m pelican
21+
22+
- name: Upload files
23+
id: deployment
24+
uses: actions/upload-pages-artifact@v3
25+
with:
26+
path: output/
27+
28+
deploy:
29+
needs: build
30+
31+
permissions:
32+
pages: write # to deploy to Pages
33+
id-token: write # to verify the deployment originates from an appropriate source
34+
35+
# Deploy to the github-pages environment
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
40+
# Specify runner + deployment step
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
46+
47+
# - name: Deploy
48+
# uses: peaceiris/actions-gh-pages@v3
49+
# # If you’re changing the branch from main,
50+
# # also change the `main` in `refs/heads/main`
51+
# # below accordingly.
52+
# if: ${{ github.ref == 'refs/heads/main' }}
53+
# with:
54+
# github_token: ${{ secrets.GITHUB_TOKEN }}
55+
# publish_dir: ./public
56+
# force_orphan: true
57+
# cname: bookish-telegram.thrsten.pages.github.io

0 commit comments

Comments
 (0)