Skip to content

Commit

Permalink
Add workflow to publish static site
Browse files Browse the repository at this point in the history
  • Loading branch information
Javex committed Oct 1, 2023
1 parent 05909c8 commit 7f98515
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/site-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Site

on:
push:
branches: [ "main" ]

# env:
# # Use docker.io for Docker Hub if empty
# REGISTRY: ghcr.io
# # github.repository as <account>/<repo>
# IMAGE_NAME: ${{ github.repository }}


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: npm install
working-directory: web/

- name: Build static site
run: node bundle.js
working-directory: web/

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: "${{ vars.TARGET_ROLE_ARN }}"
aws-region: ap-southeast-2

- name: Upload site to S3
run: aws s3 sync ./static/ s3://hotprices.org/

0 comments on commit 7f98515

Please sign in to comment.