Skip to content

Commit

Permalink
Added deployment action
Browse files Browse the repository at this point in the history
  • Loading branch information
AnXh3L0 authored Jul 30, 2024
1 parent 0aa6d62 commit 560b8f1
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Deploy Hugo Site to GitHub Pages

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

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

- name: Cache node_modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.16.0'

- name: Install dependencies
run: |
npm ci
npm -g install js-beautify
- name: Cache Hugo
id: cache-hugo
uses: actions/cache@v3
with:
path: ./hugo
key: ${{ runner.os }}-hugo-0.129.0-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-hugo-0.129.0-
- name: Install Hugo
if: steps.cache-hugo.outputs.cache-hit != 'true'
run: |
wget https://github.com/gohugoio/hugo/releases/download/v0.129.0/hugo_extended_0.129.0_Linux-64bit.tar.gz
tar -xzf hugo_extended_0.129.0_Linux-64bit.tar.gz hugo
rm hugo_extended_0.129.0_Linux-64bit.tar.gz
- name: Build Hugo site
run: ./hugo -d public

- name: Create CNAME file
run: echo 'bridgebeam.design' > public/CNAME

- name: Beautify HTML files
run: find public/ -type f -name "*.html" -exec js-beautify --html -r -m 1 "{}" \;

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

0 comments on commit 560b8f1

Please sign in to comment.