Update deploy.yml #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |