Skip to content

Commit f8b71cd

Browse files
committed
feat: S3 upload
1 parent 7edb84e commit f8b71cd

File tree

1 file changed

+34
-18
lines changed

1 file changed

+34
-18
lines changed

.github/workflows/node.js.yml

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 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
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
33

4-
name: Node.js CI
4+
name: Node.js CI and Deploy
55

66
on:
77
push:
@@ -29,26 +29,42 @@ jobs:
2929
- run: yarn build
3030
# - run: yarn test
3131
- name: Upload distribution artifacts
32-
uses: actions/upload-pages-artifact@v3
32+
uses: actions/upload-artifact@v4
3333
with:
34-
name: github-pages
34+
name: build-artifacts
3535
path: dist
3636

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
4041

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: .
4549

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/
5056

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

Comments
 (0)