Merge pull request #31 from loganmarchione/dokuwiki #87
This file contains hidden or 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 | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
deploy-development: | |
uses: ./.github/workflows/development.yml | |
secrets: inherit | |
deploy-production: | |
name: Deploy (loganmarchione.com) | |
needs: deploy-development | |
runs-on: ubuntu-latest | |
env: | |
HUGO_VERSION: '0.146.7' | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Install Hugo CLI | |
run: | | |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_withdeploy_${HUGO_VERSION}_linux-amd64.deb \ | |
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb | |
- name: Install Dart Sass | |
run: sudo snap install dart-sass | |
- name: Check out the codebase | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.ROLE_TO_ASSUME_ARN_PRD }} | |
role-duration-seconds: 900 | |
aws-region: us-east-2 | |
- name: Update CloudFront Distribution | |
run: sed -i "s/CLOUDFRONT_DISTRIBUTION_PRD/${{ secrets.CLOUDFRONT_DISTRIBUTION_PRD }}/g" hugo.yaml | |
- name: Build | |
run: hugo --gc --baseURL="https://${{ env.URL }}" | |
env: | |
URL: loganmarchione.com | |
- name: Deploy to S3 | |
run: hugo deploy --maxDeletes -1 --invalidateCDN --target loganmarchione-com --logLevel info |