Skip to content

Commit

Permalink
feat: gh action for hugo (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-burt-uch authored Jun 12, 2024
1 parent 7fe6b88 commit b7a4a7a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 27 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/hugo_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Hugo Build and Deploy

on: push

env:
BASE_URL: ${{ (github.ref == 'refs/heads/master' && 'gen3.org') || 'alpha.gen3.org' }}

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.100.2'
extended: true

- name: Setup Asciidoctor
run: sudo apt-get install -y asciidoctor # support asciidoc files

- name: Update Config (replace {BASE_URL})
run: sed -i "s|{BASE_URL}|${BASE_URL}|g" config.yaml

- name: Build Site
run: hugo

- name: Install AWS CLI
uses: chrislennon/[email protected]

- name: Deploy to S3
run: |
aws s3 cp public s3://${{ env.BASE_URL }}/ --recursive --region ${{ vars.AWS_REGION }} --acl public-read
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ themes_used
*.DS_Store
./resources/
*/_gen/
.idea
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

0 comments on commit b7a4a7a

Please sign in to comment.