@@ -20,36 +20,42 @@ jobs:
2020 runs-on : ubuntu-latest
2121 steps :
2222 - name : Checkout
23- uses : actions/checkout@v4
23+ uses : actions/checkout@v4 # Use actions/checkout@v4 to check out the repository
2424 - name : Set up Node.js
2525 uses : actions/setup-node@v4
2626 with :
27- node-version : ' 20'
27+ node-version : ' 20' # Use Node.js version 20
2828 - name : Install dependencies
29- run : npm install
29+ run : npm install # Install your React app's dependencies
3030 - name : Build React app
31- run : npm run build:react
31+ run : npm run build:react # Build your React app
3232 - name : Bundle the app with Webpack
33- run : npm run build:bundle
33+ run : npm run build:bundle # Optionally, run Webpack bundling
34+ - name : List files in the build directory
35+ run : ls -l build # List files in the build directory to confirm it has content
3436 - name : Upload artifact
35- uses : actions/upload-artifact@v4
37+ uses : actions/upload-artifact@v4 # Upload the build directory as an artifact
3638 with :
37- name : react-build
38- path : build
39+ name : react-build # Name of the artifact
40+ path : build # The directory to upload
3941
42+ # Deployment job
4043 deploy :
4144 environment :
42- name : github-pages
43- url : ${{ steps.deployment.outputs.page_url }}
45+ name : github-pages # Name of the environment
46+ url : ${{ steps.deployment.outputs.page_url }} # URL of the deployed page
4447 runs-on : ubuntu-latest
45- needs : build
48+ needs : build # Make sure this job runs after the build job
4649 steps :
50+ - name : Checkout
51+ uses : actions/checkout@v4 # Check out the repository again for deployment
4752 - name : Download artifact
48- uses : actions/download-artifact@v4
53+ uses : actions/download-artifact@v4 # Download the previously uploaded artifact
4954 with :
50- name : react-build # Ensure this matches the artifact name in the build job
55+ name : react-build # The name of the artifact to download
56+ - name : List files in the downloaded artifact
57+ run : ls -l react-build # Verify that the artifact is downloaded correctly
5158 - name : Deploy to GitHub Pages
52- uses : actions/deploy-pages@v4 # Official GitHub Pages deploy action
59+ uses : actions/deploy-pages@v4 # Official GitHub Pages deployment action
5360 with :
54- token : ${{ secrets.GITHUB_TOKEN }}
55-
61+ token : ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication
0 commit comments