Merge pull request #69 from Lijk117/main #139
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: Build and deploy to prod. | |
env: | |
AWS_REGION: us-east-2 | |
APP_ENV: prod | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'MixinNetwork' | |
steps: | |
- uses: actions/checkout@master | |
- name: Setup node env | |
uses: actions/setup-node@master | |
with: | |
node-version: "14.20.0" | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
node_modules | |
**/node_modules | |
key: ${{ runner.os }}-${{ hashFiles('./yarn.lock') }} | |
- run: yarn --non-interactive --frozen-lockfile | |
- run: APP_ENV=${{ env.APP_ENV }} yarn docs:build | |
- uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-region: ${{ env.AWS_REGION }} | |
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.PROD_AWS_ACCESS_KEY_SECRET }} | |
- run: aws s3 cp --recursive docs/.vuepress/dist ${{ secrets.S3_URL_PROD }} --acl public-read | |
- run: aws s3 cp --recursive docs/.vuepress/dist ${{ secrets.S3_URL_PROD }} --exclude "*" --include "*.html" --cache-control "no-cache" --acl public-read |