Skip to content

Commit

Permalink
Add Hugo deployment over workflow
Browse files Browse the repository at this point in the history
Initial hugo deployment over workflow

Signed-off-by: Denys Fedoryshchenko <[email protected]>
  • Loading branch information
nuclearcat committed Apr 24, 2024
1 parent 122cf04 commit 2158fe3
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Hugo Staging Deploy

on:
push:
branches:
- main
- add-hugo-deployment
pull_request:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-22.04
environment: sshdeploy
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
lfs: true # Fetch Git LFS files

# no idea why, but checkout submodules doesn't work properly
#- name: git submodule update --init --recursive
# run: git submodule update --init --recursive

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
# The action defaults to search for the dependency file (package-lock.json,
# npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its
# hash as a part of the cache key.
# https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies (postcss), bootstrap-sass
run: npm install --save-dev autoprefixer && npm install postcss-cli && npm install -D postcss && npm install -D postcss-preset-env && npm install -D bootstrap-sass

- name: Build
run: cd kernelci.org;hugo --minify

# - name: Deploy
# uses: peaceiris/actions-gh-pages@v3
# if: github.ref == 'refs/heads/main'
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./public

# - name: Deploy over SSH
# uses: easingthemes/[email protected]
# with:
# REMOTE_HOST: ${{ secrets.HOSTING_DEPLOY_HOST }}
# REMOTE_USER: deploy
# REMOTE_PORT: 22
# SOURCE: "kernelci.org/public/"
# TARGET: "/var/www/html"
# ARGS: "-avz --delete"
# SSH_PRIVATE_KEY: ${{ secrets.HOSTING_DEPLOY_KEY }}
# # dry_run: true
# # debug: true

0 comments on commit 2158fe3

Please sign in to comment.