Skip to content

Commit 2ef2dc4

Browse files
committed
needle github pages workflow
1 parent 548f341 commit 2ef2dc4

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/needle-pages.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Needle Pages Setup
2+
3+
on:
4+
push:
5+
branches:
6+
- needle-github-pages
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
deploy:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
ref: needle-github-pages
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Ensure CNAME exists
33+
run: echo "three.needle.tools" > CNAME
34+
35+
- name: Ensure .nojekyll exists
36+
run: touch .nojekyll
37+
38+
- name: Commit files if missing
39+
run: |
40+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
41+
git config --local user.name "github-actions[bot]"
42+
git add CNAME .nojekyll
43+
if git diff --staged --quiet; then
44+
echo "Files already exist in repository"
45+
else
46+
git commit -m "Add CNAME and .nojekyll files"
47+
git push
48+
fi
49+
50+
- name: Setup Pages
51+
uses: actions/configure-pages@v4
52+
53+
- name: Upload artifact
54+
uses: actions/upload-pages-artifact@v3
55+
with:
56+
path: '.'
57+
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)