Skip to content

deploy

deploy #14

Workflow file for this run

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 }}