Skip to content

chriswachira triggered a Hugo site deployment #19

chriswachira triggered a Hugo site deployment

chriswachira triggered a Hugo site deployment #19

Workflow file for this run

name: Deploy website changes to production S3 bucket
run-name: ${{ github.actor }} triggered a Hugo site deployment
on:
push:
branches:
- "main"
pull_request:
jobs:
publish-site:
name: "Publish site to S3 bucket"
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Hugo & other CI dependencies
run: |
sudo apt install wget gettext-base
wget https://github.com/gohugoio/hugo/releases/download/v0.120.1/hugo_0.120.1_linux-amd64.deb
sudo dpkg -i hugo_0.120.1_linux-amd64.deb
- name: Install AWS CLI
run: sudo snap install aws-cli --classic
- name: Apply env variables to Hugo config file
env:
SITE_BASE_URL: ${{ vars.SITE_BASE_URL }}
run: envsubst < config.yaml > new-config.yaml
- name: Remove any previously generated public/ directory
run: rm -rf public/
- name: Generate public directory
run: hugo --config new-config.yaml
- name: Test public
run: |
du -sh public/
cat new-config.yaml
# - name: Push public directory contents to S3 bucket
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
# run: aws s3 cp --recursive public/ s3://chriswachira-com