Skip to content

Commit

Permalink
combine deploy workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mldangelo committed Oct 1, 2023
1 parent b2051bf commit 949bb90
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 45 deletions.
45 changes: 38 additions & 7 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ on:
- synchronize
push:
branches: [ 'main' ]
defaults:
run:
working-directory: ./smart-camera-web

jobs:
test:
uses: ./.github/workflows/test.yml
deploy-preview:
deploy-preview-camera-web:
needs: [test]
defaults:
run:
working-directory: ./smart-camera-web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -28,8 +29,8 @@ jobs:
- run: npm ci
- run: npm run build
- name: set destination directory
id: set_dest_dir
run: echo "DEST_DIR=js/preview-$GITHUB_HEAD_REF" >> "$GITHUB_OUTPUT"
id: set_dest_dir_camera_web
run: echo "DEST_DIR_CAMERA_WEB=js/preview-$GITHUB_HEAD_REF" >> "$GITHUB_ENV"
- name: deploy preview to s3
uses: jakejarvis/[email protected]
with:
Expand All @@ -39,4 +40,34 @@ jobs:
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_dest_dir.outputs.DEST_DIR }}
DEST_DIR: ${{ env.DEST_DIR_CAMERA_WEB }}

deploy-preview-hosted-web:
needs: [test]
defaults:
run:
working-directory: ./hosted-web-integration
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 && npm run build:dist
- name: set destination directory
id: set_dest_dir_hosted_web
run: echo "DEST_DIR_HOSTED_WEB=inline/preview-$GITHUB_HEAD_REF" >> "$GITHUB_ENV"
- name: deploy preview to s3
uses: jakejarvis/[email protected]
with:
args: --follow-symlinks --delete
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 }}
SOURCE_DIR: "./dist"
DEST_DIR: ${{ env.DEST_DIR_HOSTED_WEB }}
38 changes: 0 additions & 38 deletions hosted-web-integration/.github/workflows/deploy-preview.yml

This file was deleted.

0 comments on commit 949bb90

Please sign in to comment.