Skip to content

Deploy to Beta

Deploy to Beta #123

Workflow file for this run

name: Deploy to Beta
permissions:
id-token: write
contents: read
on:
workflow_dispatch:
push:
branches:
- 'develop'
jobs:
build:
runs-on: ubuntu-latest
environment: Beta
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: '14'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.BETA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.BETA_AWS_SECRET_ACCESS_KEY }}
- name: set keys and deploy
env:
GATSBY_ALGOLIA_APP_ID: ${{ secrets.GATSBY_ALGOLIA_APP_ID}}
GATSBY_ALGOLIA_DEV_KEY: ${{secrets.GATSBY_ALGOLIA_DEV_KEY}}
ALGOLIA_ADMIN_KEY: ${{secrets.ALGOLIA_ADMIN_KEY}}
DIST_ID: ${{secrets.BETA_DIST_ID}}
PM_TECH_RT: ${{secrets.PM_TECH_RT}}
SITE_URL: ${{secrets.BETA_SITE_URL}}
DOMAIN_NAME: ${{secrets.BETA_DOMAIN_NAME}}
run: |
npm config set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
npm install
npm run clean
npm run build:dev
aws s3 sync ./public/ s3://${{secrets.BETA_BUCKET_NAME}}/${{ github.ref_name }}/labs --delete
- name: invalidate
uses: chetan/invalidate-cloudfront-action@v2
env:
PATHS: '/*'
AWS_REGION: '${{ secrets.AWS_REGION }}'
DISTRIBUTION: ${{ secrets.BETA_DIST_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.BETA_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.BETA_AWS_SECRET_ACCESS_KEY }}