Update dependencies #89
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: | |
branches: | |
- main | |
# Review gh actions docs if you want to further define triggers, paths, etc | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on | |
env: | |
AWS_DEFAULT_REGION: us-east-1 | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
# These permissions are needed to interact with GitHub's OIDC Token endpoint. | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3 | |
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3 | |
with: | |
node-version: 16.x | |
cache: yarn | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build documentation | |
env: | |
URL: ${{ secrets.URL }} | |
BASE_PATH: docs/ | |
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }} | |
ALGOLIASEARCH_API_KEY: ${{ secrets.ALGOLIASEARCH_API_KEY }} | |
ALGOLIASEARCH_APPLICATION_ID: ${{ secrets.ALGOLIASEARCH_APPLICATION_ID }} | |
ALGOLIASEARCH_INDEX_NAME: ${{ secrets.ALGOLIASEARCH_INDEX_NAME }} | |
run: yarn build | |
- name: Configure AWS credentials using GitHub OIDC provider | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
aws-region: ${{ env.AWS_DEFAULT_REGION }} | |
- name: Deploy to Amazon S3 Bucket | |
env: | |
AWS_BUCKET_NAME: ${{ secrets.AWS_BUCKET_NAME }} | |
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} | |
run: | | |
aws s3 sync --delete --exact-timestamps ./build/ s3://${AWS_BUCKET_NAME}/docs --region ${AWS_DEFAULT_REGION} | |
aws cloudfront create-invalidation --distribution-id ${AWS_CLOUDFRONT_DISTRIBUTION_ID} --paths '/*' |