Skip to content

Merge pull request #9 from cosmology-tech/anmol/deploy-workflow #2

Merge pull request #9 from cosmology-tech/anmol/deploy-workflow

Merge pull request #9 from cosmology-tech/anmol/deploy-workflow #2

Workflow file for this run

name: Build and Deploy Docs
on:
push:
branches:
- main
pull_request:
types: [opened, reopened]
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- name: Checkout Repository 🛎️
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install Dependencies
run: yarn install
- name: Build Project
run: yarn export
- name: Deploy to S3
if: github.ref == 'refs/heads/main' || github.event_name != 'pull_request'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-east-1'
run: yarn deploy
- name: Invalidate CloudFront
if: github.ref == 'refs/heads/main' || github.event_name != 'pull_request'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-east-1'
run: yarn invalidate