Web Deploy #882
Workflow file for this run
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: Web Deploy | |
concurrency: | |
group: prod_environment | |
cancel-in-progress: true | |
on: | |
push: | |
tags: | |
- '*standardnotes/*web*' | |
- '!*standardnotes/*web*beta*' | |
- '!*standardnotes/*web*alpha*' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Build | |
run: yarn build:web | |
- 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: us-east-1 | |
- name: Deploy static site to S3 bucket | |
run: aws s3 sync packages/web/dist/ s3://app.standardnotes.com --delete | |
- name: Invalidate CloudFront Cache | |
uses: chetan/invalidate-cloudfront-action@master | |
env: | |
DISTRIBUTION: ${{ secrets.WEBAPP_CLOUDFRONT_COM_DISTRIBUTION_ID }} | |
PATHS: '/*' | |
AWS_REGION: 'us-east-1' | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
notify_discord: | |
needs: deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Run Discord Webhook | |
uses: johnnyhuy/actions-discord-git-webhook@main | |
with: | |
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }} |