Fix GitHub actions part 4 #7
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 to AWS | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build library | |
run: npm run build | |
- name: Prepare for publish | |
run: npm run aws | |
- name: Archive build | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download build | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
- name: Uploading to Amazon S3 | |
uses: jakejarvis/s3-sync-action@master | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
SOURCE_DIR: dist | |
DEST_DIR: ${{ github.event.repository.name }} |