Add nextech link #37
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 | |
jobs: | |
deploy: | |
permissions: | |
id-token: write | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE }} | |
role-session-name: github-actions-deploy | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Install Ruby and gems | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2' | |
bundler-cache: true | |
- name: Build S3 config file | |
run: ruby yaml_to_s3_json_config_converter.rb | |
- name: Build Jekyll site | |
run: bundle exec jekyll build | |
- name: Deploy to S3 | |
run: > | |
aws s3 sync _site/ s3://${{ secrets.S3_BUCKET }} --exclude compose.yml --exclude README.md --exclude *.json --exclude *.rb --delete && | |
aws s3api put-bucket-website --bucket ${{ secrets.S3_BUCKET }} --website-configuration file://s3_config.json | |
- name: Invalid CloudFront Distribution | |
run: > | |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" |