@@ -15,45 +15,42 @@ concurrency:
1515 cancel-in-progress : false
1616
1717jobs :
18- # Build job
1918 build :
2019 runs-on : ubuntu-latest
2120 steps :
2221 - name : Checkout
23- uses : actions/checkout@v4 # Use actions/checkout@v4 to check out the repository
22+ uses : actions/checkout@v4
2423 - name : Set up Node.js
2524 uses : actions/setup-node@v4
2625 with :
27- node-version : ' 20' # Use Node.js version 20
26+ node-version : ' 20'
2827 - name : Install dependencies
29- run : npm install # Install your React app's dependencies
28+ run : npm install
3029 - name : Build React app
31- run : npm run build:react # Build your React app
30+ run : npm run build:react
3231 - name : Bundle the app with Webpack
33- run : npm run build:bundle # Optionally, run Webpack bundling
32+ run : npm run build:bundle
3433 - name : List files in the build directory
35- run : ls -l build # List files in the build directory to confirm it has content
34+ run : ls -l ./ build # Ensure that files exist in the build directory
3635 - name : Upload artifact
37- uses : actions/upload-artifact@v4 # Upload the build directory as an artifact
36+ uses : actions/upload-artifact@v4
3837 with :
39- name : react-build # Name of the artifact
40- path : build # The directory to upload
38+ name : react-build
39+ path : build # Ensure the path to the build directory is correct
4140
42- # Deployment job
4341 deploy :
44- environment :
45- name : github-pages # Name of the environment
46- url : ${{ steps.deployment.outputs.page_url }} # URL of the deployed page
42+ needs : build
4743 runs-on : ubuntu-latest
48- needs : build # Make sure this job runs after the build job
4944 steps :
5045 - name : Checkout
51- uses : actions/checkout@v4 # Check out the repository again for deployment
46+ uses : actions/checkout@v4
5247 - name : Download artifact
53- uses : actions/download-artifact@v4 # Download the previously uploaded artifact
48+ uses : actions/download-artifact@v4
5449 with :
55- name : react-build # The name of the artifact to download
50+ name : react-build # Correct artifact name
51+ - name : List files after download
52+ run : ls -l build # Confirm the artifact was downloaded correctly
5653 - name : Deploy to GitHub Pages
57- uses : actions/deploy-pages@v4 # Official GitHub Pages deployment action
54+ uses : actions/deploy-pages@v4
5855 with :
59- token : ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication
56+ token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments