@@ -2,8 +2,8 @@ name: Deploy React App with GitHub Pages
22
33on :
44 push :
5- branches : ["main"] # Trigger on pushes to the main branch
6- workflow_dispatch : # Allows for manual triggering
5+ branches : ["main"]
6+ workflow_dispatch :
77
88permissions :
99 contents : write
1919 runs-on : ubuntu-latest
2020 steps :
2121 - name : Checkout
22- uses : actions/checkout@v1
22+ uses : actions/checkout@v3
2323 - name : Set up Node.js
24- uses : actions/setup-node@v1
24+ uses : actions/setup-node@v3
2525 with :
2626 node-version : ' 20'
2727 - name : Install dependencies
@@ -33,24 +33,24 @@ jobs:
3333 - name : List files in the build directory
3434 run : ls -l ./build
3535 - name : Upload artifact
36- uses : actions/upload-pages-artifact@v1
36+ uses : actions/upload-pages-artifact@v2
3737 with :
38- name : github-pages # Name the artifact as 'react-build'
39- path : ./build # Path to the build output directory
38+ name : github-pages
39+ path : ./build
4040
4141 deploy :
4242 needs : build
4343 runs-on : ubuntu-latest
4444 steps :
4545 - name : Checkout
46- uses : actions/checkout@v1
46+ uses : actions/checkout@v3
4747 - name : Download artifact
48- uses : actions/download-artifact@v4
48+ uses : actions/download-artifact@v2
4949 with :
50- name : github-pages # Name should match the uploaded artifact name
50+ name : github-pages
5151 - name : List files after download
52- run : ls -l # Confirm the artifact was downloaded correctly
52+ run : ls -l
5353 - name : Deploy to GitHub Pages
5454 uses : actions/deploy-pages@v1
5555 with :
56- token : ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication
56+ token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments