This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
Production Build #194
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: Production Build | |
on: | |
workflow_run: | |
workflows: ['CI'] | |
branches: ['main'] | |
types: | |
- completed | |
jobs: | |
deploy: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
fetch-depth: 0 | |
- name: Prepare Deploy | |
uses: ./.github/actions/prepare-deploy | |
with: | |
main-branch-name: main | |
app-configuration: production | |
nx-command: run-many | |
build-compodoc: false | |
build-storybook: false | |
- name: Setup additional pages | |
run: | | |
mkdir -p deploy/apps/ccf | |
cp -r static/* deploy/apps/ccf/ | |
cp deploy/apps/ccf/index.html deploy/apps/ccf/404.html | |
touch deploy/apps/ccf/.nojekyll | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Deploy to S3 | |
run: | | |
aws s3 sync --delete deploy/apps/ccf/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/humanatlas.io/ | |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/*" | |
- name: Publish | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: deploy/apps/ccf | |
commit_message: 'Production deploy -- ${{ github.event.head_commit.message }}' |