File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments