File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ name : MAIN CI
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ Deploy :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout source code
14+ uses : actions/checkout@v3
15+
16+ - name : Get pnpm store path
17+ id : pnpm-cache-path
18+ run : echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_ENV
19+
20+ - name : Cache pnpm modules
21+ id : cache
22+ uses : actions/cache@v3
23+ with :
24+ path : ${{ env.STORE_PATH }}
25+ key : ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
26+ restore-keys : |
27+ ${{ runner.os }}-pnpm-
28+ ${{ runner.os }}-
29+
30+ - name : Install Dependencies
31+ if : steps.cache.outputs.cache-hit != 'true'
32+ run : |
33+ pnpm install --frozen-lockfile
34+ pnpm store prune
35+
36+ - name : Build
37+ run : pnpm run build
38+
39+ - name : Configure AWS Credentials
40+ uses : aws-actions/configure-aws-credentials@v2
41+ with :
42+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
43+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
44+ aws-region : ${{ secrets.AWS_REGION }}
45+
46+ - name : Deploy to S3
47+ run : aws s3 sync ./build s3://${{ secrets.AWS_BUCKET_NAME }} --delete
48+
49+ - name : Invalidate CloudFront Cache
50+ run : aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/*"
You can’t perform that action at this time.
0 commit comments