Merge pull request #434 from rsksmart/add-rskip-434 #121
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 Jekyll site to prod environment | |
on: | |
push: | |
branches: | |
- 'master' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- 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 }} | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: "Build Site" | |
run: bundle exec jekyll build | |
env: | |
JEKYLL_ENV: production | |
- name: "Deploy to AWS S3" | |
run: aws s3 sync ./_site/ ${{ secrets.AWS_S3_BUCKET_NAME }} --delete --sse | |
- name: "Create AWS Cloudfront Invalidation" | |
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" |