Add CloudFront post back to dev site #57
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: CI/CD (development) | |
on: | |
pull_request: | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
loganmarchione-github-io: | |
name: Deploy (loganmarchione.github.io) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the codebase | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.18' | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.120.1' | |
extended: true | |
- name: Build | |
run: hugo --gc -DEF --baseURL="https://${{ env.URL }}" | |
env: | |
URL: loganmarchione.github.io | |
- name: Overwrite robots.txt (for search engines) | |
run: | | |
: > ./public/robots.txt | |
echo "User-agent: *" >> ./public/robots.txt | |
echo "Disallow: /" >> ./public/robots.txt | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.PERSONAL_TOKEN }} | |
external_repository: loganmarchione/loganmarchione.github.io | |
publish_branch: gh-pages | |
publish_dir: ./public | |
loganmarchione-dev: | |
name: Deploy (loganmarchione.dev) | |
needs: loganmarchione-github-io | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Check out the codebase | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.18' | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.120.1' | |
extended: true | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.ROLE_TO_ASSUME_ARN_DEV }} | |
role-duration-seconds: 900 | |
aws-region: us-east-2 | |
- name: Update CloudFront Distribution | |
run: sed -i "s/CLOUDFRONT_DISTRIBUTION_DEV/${{ secrets.CLOUDFRONT_DISTRIBUTION_DEV }}/g" config.yaml | |
- name: Build | |
run: hugo --gc -DEF --baseURL="https://${{ env.URL }}" | |
env: | |
URL: loganmarchione.dev | |
- name: Overwrite robots.txt (for search engines) | |
run: | | |
: > ./public/robots.txt | |
echo "User-agent: *" >> ./public/robots.txt | |
echo "Disallow: /" >> ./public/robots.txt | |
- name: Deploy to S3 | |
run: hugo deploy --maxDeletes -1 --invalidateCDN --target loganmarchione-dev --logLevel info |