Skip to content

Merge pull request #20 from toadslop/landing-page #11

Merge pull request #20 from toadslop/landing-page

Merge pull request #20 from toadslop/landing-page #11

name: Build and Publish to AWS
on:
push:
branches:
- main
paths:
- static-site/**
jobs:
deploy:
name: Build and Deploy
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
id: checkout
- name: Install Zola
id: install-zola
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Setup Node
id: setup-node
uses: actions/setup-node@v4
- name: Install Node Packages
id: install-node-packages
run: npm install
- name: Build Static Site
id: build-static-site
working-directory: ./static-site
run: zola build
- name: Configure AWS Credentials
id: configure-aws-creds
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ vars.STATIC_DEPLOYER_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.STATIC_DEPLOY_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-1
- name: Deploy static site to S3 bucket
id: deploy-to-s3
run: aws s3 sync ./static-site/public s3://${{ vars.S3_BUCKET }} --delete