Merge pull request #926 from Permify/docs #55
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: Publish Docs | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'docs/**' | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install Dependencies | |
run: | | |
cd docs | |
yarn install | |
- name: Build Project | |
run: | | |
cd docs | |
yarn build | |
- name: Deploy to S3 | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read --follow-symlinks --delete | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_DOCS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: 'us-east-1' | |
SOURCE_DIR: 'docs/build/' | |
DEST_DIR: '' | |
- name: Invalidate CloudFront Distribution | |
uses: chetan/invalidate-cloudfront-action@master | |
env: | |
DISTRIBUTION: ${{ secrets.DISTRIBUTION }} | |
PATHS: '/*' | |
AWS_REGION: 'us-east-1' | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |