Skip to content

Build and Publish to AWS #7

Build and Publish to AWS

Build and Publish to AWS #7

name: Build and Publish to AWS
on:
push:
branches:
- main
paths:
- static-site/**
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: Build
working-directory: ./static-site
run: zola build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
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
run: aws s3 sync ./static-site/public s3://${{ vars.S3_BUCKET }} --delete