Remove rollup content #21
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: Hugo s3 deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install Hugo CLI | |
run: | | |
sudo snap install hugo | |
- name: Build | |
run: hugo --minify --destination dist --source init4 --theme papermod | |
- name: Archive build directory | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: init4/dist | |
deploy-prod: | |
environment: | |
name: Production | |
# only runs when the branch is main | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download build artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.IAM_DEPLOYER_ROLE }} | |
role-session-name: github_federated_aws | |
aws-region: ${{ vars.AWS_REGION }} | |
- name: Deploy Site to S3 | |
env: | |
AWS_S3_BUCKET : ${{ secrets.AWS_S3_BUCKET }} | |
run: | | |
aws s3 sync --delete --sse AES256 /home/runner/work/.github/.github $AWS_S3_BUCKET |