ConditionBuilder for alarm v1 #52
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: HiveCommand WebApp | |
on: | |
push: | |
branches: | |
- staging | |
- master | |
paths: [ ".github/workflows/webapp.yml", "packages/core-ui/**", "packages/app/hivecommand-api/**", "packages/app/hivecommand-frontend/**" ] | |
concurrency: hivecommand-webapp-${{ github.ref }} | |
jobs: | |
build_webapp: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
apps: [ frontend ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.x | |
- run: yarn | |
- name: Setup stack | |
run: | | |
echo "PUBLIC_PATH=https://staging-apps.hexhive.io/${{matrix.apps}}/" >> $GITHUB_ENV | |
echo "REACT_APP_API=https://staging-api.hexhive.io" >> $GITHUB_ENV | |
if: ${{ github.ref == 'refs/heads/staging' }} | |
- name: Setup stack | |
run: | | |
echo "PUBLIC_PATH=https://next-apps.hexhive.io/${{matrix.apps}}/" >> $GITHUB_ENV | |
echo "REACT_APP_API=https://next-api.hexhive.io" >> $GITHUB_ENV | |
if: ${{ github.ref == 'refs/heads/next' }} | |
- name: Setup stack | |
run: | | |
echo "PUBLIC_PATH=https://apps.hexhive.io/${{matrix.apps}}/" >> $GITHUB_ENV | |
echo "REACT_APP_API=https://api.hexhive.io" >> $GITHUB_ENV | |
if: ${{ github.ref == 'refs/heads/master' }} | |
- name: Build web | |
run: (export NODE_ENV=production CI=false; lerna run build --scope @hive-command/${{ matrix.apps }} --include-dependencies) | |
env: | |
NODE_OPTIONS: "--max-old-space-size=7168" | |
- name: Configure AWS Creds | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-southeast-2 | |
- name: Setup stack | |
run: | | |
echo "BUCKET_URL=${{ secrets.STAGING_APP_BUCKET }}" >> $GITHUB_ENV | |
if: ${{ github.ref == 'refs/heads/staging' }} | |
- name: Setup stack | |
run: | | |
echo "BUCKET_URL=${{ secrets.NEXT_APP_BUCKET }}" >> $GITHUB_ENV | |
if: ${{ github.ref == 'refs/heads/next' }} | |
- name: Setup stack | |
run: | | |
echo "BUCKET_URL=${{ secrets.PROD_APP_BUCKET }}" >> $GITHUB_ENV | |
if: ${{ github.ref == 'refs/heads/master' }} | |
- name: Upload new web-build | |
run: | | |
aws s3 sync packages/app/hivecommand-${{ matrix.apps }}/dist/ s3://${{ env.BUCKET_URL }}/hivecommand-${{matrix.apps}} --delete |