fix: Update security feedback method #22
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: deploy | |
on: | |
push: | |
branches: | |
- main | |
- staging | |
repository_dispatch: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build site | |
runs-on: ubuntu-latest | |
environment: | |
name: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }} | |
url: ${{ github.ref == 'refs/heads/main' && 'https://open.ribose.com' || 'https://staging-open.ribose.com' }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: unfor19/install-aws-cli-action@v1 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
bundler-cache: true | |
- name: Build site | |
env: | |
JEKYLL_ENV: production | |
run: | | |
make _site | |
- name: Upload to AWS | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} | |
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} | |
run: | | |
aws s3 sync _site s3://$S3_BUCKET_NAME --region=$AWS_REGION --delete --no-progress --exclude "*" --include "*.html" --content-type "text/html; charset=utf-8" | |
aws s3 sync _site s3://$S3_BUCKET_NAME --region=$AWS_REGION --delete --no-progress --exclude "*" --include "*.json" --content-type "text/json; charset=utf-8" | |
aws s3 sync _site s3://$S3_BUCKET_NAME --region=$AWS_REGION --delete --no-progress --exclude "*.html,*.json" --include "*" | |
aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*" |