Production Build #30
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: Deploy to S3 | |
run: | | |
aws s3 sync --delete deploy/apps/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/ui/ | |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} --paths "/ui/*" | |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_HUMANATLAS_IO_DISTRIBUTION_ID }} --paths "/*" | |
- name: Publish | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: deploy/apps | |
commit_message: 'Production deploy -- ${{ github.event.head_commit.message }}' |