Skip to content

fix: s3 sync dist path #12

fix: s3 sync dist path

fix: s3 sync dist path #12

Workflow file for this run

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
- name: Install Hugo CLI
run: |
sudo snap install hugo
- name: Build
run: hugo --minify --destination dist --source init4
- 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 .github/ $AWS_S3_BUCKET