|
1 | 1 | # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node |
2 | 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs |
3 | 3 |
|
4 | | -name: Node.js CI |
| 4 | +name: Node.js CI and Deploy |
5 | 5 |
|
6 | 6 | on: |
7 | 7 | push: |
@@ -29,26 +29,42 @@ jobs: |
29 | 29 | - run: yarn build |
30 | 30 | # - run: yarn test |
31 | 31 | - name: Upload distribution artifacts |
32 | | - uses: actions/upload-pages-artifact@v3 |
| 32 | + uses: actions/upload-artifact@v4 |
33 | 33 | with: |
34 | | - name: github-pages |
| 34 | + name: build-artifacts |
35 | 35 | path: dist |
36 | 36 |
|
37 | | - deploy: |
38 | | - runs-on: ubuntu-latest |
39 | | - needs: build |
| 37 | + # deploy: |
| 38 | + # runs-on: ubuntu-latest |
| 39 | + # needs: build |
| 40 | + # if: github.ref == 'refs/heads/main' # Only deploy on main branch |
40 | 41 |
|
41 | | - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment |
42 | | - permissions: |
43 | | - pages: write # to deploy to Pages |
44 | | - id-token: write # to verify the deployment originates from an appropriate source |
| 42 | + # steps: |
| 43 | + # - uses: actions/checkout@v4 |
| 44 | + # - name: Download build artifacts |
| 45 | + # uses: actions/download-artifact@v4 |
| 46 | + # with: |
| 47 | + # name: build-artifacts |
| 48 | + # path: . |
45 | 49 |
|
46 | | - # Deploy to the github-pages environment |
47 | | - environment: |
48 | | - name: github-pages |
49 | | - url: ${{ steps.deployment.outputs.page_url }} |
| 50 | + # - name: Debug artifact structure |
| 51 | + # run: | |
| 52 | + # echo "Current directory structure:" |
| 53 | + # ls -la |
| 54 | + # echo "Contents of dist directory:" |
| 55 | + # ls -la dist/ |
50 | 56 |
|
51 | | - steps: |
52 | | - - name: Deploy to GitHub Pages |
53 | | - id: deployment |
54 | | - uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action |
| 57 | + # - name: Configure AWS credentials |
| 58 | + # uses: aws-actions/configure-aws-credentials@v4 |
| 59 | + # with: |
| 60 | + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 61 | + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 62 | + # aws-region: ${{ secrets.AWS_REGION }} |
| 63 | + |
| 64 | + # - name: Deploy to S3 |
| 65 | + # run: | |
| 66 | + # aws s3 sync dist/ s3://${{ secrets.S3_BUCKET }} --no-delete |
| 67 | + |
| 68 | + # - name: Invalidate CloudFront cache |
| 69 | + # run: | |
| 70 | + # aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" |
0 commit comments