Skip to content

Merge pull request #34 from tokyo-rust/add_payment_link #23

Merge pull request #34 from tokyo-rust/add_payment_link

Merge pull request #34 from tokyo-rust/add_payment_link #23

name: Build and Publish to AWS
on:
workflow_dispatch:
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: cd static-site && npm install
- name: Build Static Site
id: build-static-site
working-directory: ./static-site
run: zola build
- name: Check Links
id: lychee
uses: lycheeverse/lychee-action@v1
with:
args: --base ./static-site/public ./static-site/public
jobSummary: true
fail: true
- 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