deploy #18
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 | |
on: | |
push: | |
tags: v[1-9]+.[0-9]+.[0-9]+* | |
jobs: | |
test: | |
uses: ./.github/workflows/test.yml | |
deploy: | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set node version | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run build | |
- name: get version number | |
id: get_version | |
run: | | |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
- name: set destination directory | |
id: set_destination | |
env: | |
TAG: ${{ steps.get_version.outputs.VERSION }} | |
run: | | |
echo "DEST_DIR=js/$TAG" >> $GITHUB_OUTPUT | |
- name: deploy to s3 | |
uses: jakejarvis/[email protected] | |
with: | |
args: --follow-symlinks --delete --exclude '*' --include 'smart-camera-web.js' | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
DEST_DIR: ${{ steps.set_destination.outputs.DEST_DIR }} |