deploy #45
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* | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
test: | |
uses: ./.github/workflows/test.yml | |
smart-camera-web: | |
needs: [test] | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
defaults: | |
run: | |
working-directory: ./packages/smart-camera-web | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: get-npm-version | |
id: package-version | |
uses: martinbeentjes/[email protected] | |
with: | |
path: packages/smart-camera-web | |
- name: set destination directory | |
id: set_destination | |
env: | |
TAG: ${{ steps.package-version.outputs.current-version }} | |
run: | | |
echo "DEST_DIR_SMART_CAMERA_WEB=js/v$TAG" >> $GITHUB_OUTPUT | |
- name: configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_GITHUB_ACTIONS_ROLE }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: deploy to s3 / cloudfront | |
run: | | |
aws s3 sync --follow-symlinks --delete --exclude '*' --include 'smart-camera-web.js' . s3://${{ secrets.AWS_S3_BUCKET }}/${{ steps.set_destination.outputs.DEST_DIR_SMART_CAMERA_WEB }} | |
embed: | |
needs: [test] | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
defaults: | |
run: | |
working-directory: ./packages/embed | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: set node version | |
uses: actions/setup-node@v4 | |
- name: install dependencies | |
run: npm ci | |
- name: build application | |
env: | |
SENTRY_AUTH_TOKEN: '${{ secrets.SENTRY_AUTH_TOKEN }}' | |
run: npm run build && npm run build:dist | |
- name: configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_GITHUB_ACTIONS_ROLE }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: deploy to s3 / cloudfront | |
run: | | |
aws s3 sync --follow-symlinks --delete dist s3://${{ secrets.AWS_S3_BUCKET }}/inline/v1 |