Skip to content

Commit d964bdf

Browse files
brunoborgesCopilot
andcommitted
Add GitHub Actions workflow for Pages deployment
Triggers on pushes to main when JSON files, templates, or static assets change. Runs generate.py to build HTML pages and snippets.json, then deploys to GitHub Pages. Requires Pages source set to 'GitHub Actions' in repo settings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 02e4351 commit d964bdf

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- '*/**.json'
8+
- 'slug-template.html'
9+
- 'generate.py'
10+
- 'index.html'
11+
- 'styles.css'
12+
- 'app.js'
13+
- 'manifest.json'
14+
- 'favicon.svg'
15+
- 'assets/**'
16+
- 'images/**'
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
pages: write
22+
id-token: write
23+
24+
concurrency:
25+
group: pages
26+
cancel-in-progress: false
27+
28+
jobs:
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- uses: actions/setup-python@v5
35+
with:
36+
python-version: '3.12'
37+
38+
- name: Generate HTML pages and snippets.json
39+
run: python3 generate.py
40+
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v5
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: .
48+
49+
deploy:
50+
needs: build
51+
runs-on: ubuntu-latest
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)