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 : Build and Deploy
1+ name : Build and Deploy to GitHub Pages
22
33on :
44 push :
55 branches :
66 - ' **' # Run on all branches
77 workflow_dispatch :
88
9+ permissions :
10+ pages : write
11+ id-token : write
12+
913jobs :
1014 build :
1115 runs-on : ubuntu-latest
3438 fi
3539 fi
3640
37- - name : Upload artifacts
41+ - name : Upload build artifacts
3842 uses : actions/upload-artifact@v4
3943 with :
4044 name : build-artifacts
@@ -48,11 +52,14 @@ jobs:
4852 container : archlinux:latest
4953 needs : build
5054 if : github.ref == 'refs/heads/main'
55+ environment :
56+ name : github-pages
57+ url : ${{ steps.deployment.outputs.page_url }}
5158 steps :
5259 - name : Checkout code
5360 uses : actions/checkout@v4
5461
55- - name : Download artifacts
62+ - name : Download build artifacts
5663 uses : actions/download-artifact@v4
5764 with :
5865 name : build-artifacts
6774 echo "Root index preview:"
6875 head -n 20 public/index.html || true
6976
70- - name : Upload deploy artifacts
71- uses : actions/upload-artifact@v4
77+ - name : Upload Pages artifact
78+ uses : actions/upload-pages- artifact@v3
7279 with :
73- name : deploy-artifacts
7480 path : public
75- retention-days : 7
81+
82+ - name : Deploy to GitHub Pages
83+ id : deployment
84+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments