forked from sugarlabs/musicblocks
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.08 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Deploy MusicBlocks
on:
push:
branches:
- deploy
pull_request:
branches:
- deploy
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies without lifecycle scripts
run: npm install --ignore-scripts
- name: Debug installed scripts
run: npm run
- name: Build project
run: npm run build --if-present
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy static files
run: |
# Sync built files to deployment target (e.g., S3 bucket)
aws s3 sync ./build s3://musicblocks-prod --delete
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DIST_ID }} --paths "/*"
# Updated deploy workflow for testing