Update deployment to Github Actions

This commit is contained in:
Thomas A. Christensen II 2023-01-02 22:28:16 -06:00
parent 5c242f80b1
commit b2f77179d6
Signed by: millironx
GPG key ID: 139C07724802BC5D

View file

@ -3,22 +3,41 @@ on:
push: push:
branches: branches:
- master - master
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
defaults:
run:
shell: bash
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.108.0
NODE_VERSION: 18.12.1
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
submodules: true submodules: true
fetch-depth: 0
- name: Setup pages
id: pages
uses: actions/configure-pages@v2
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v2 uses: actions/setup-node@v3
with: with:
node-version: lts/* node-version: "${{ env.NODE_VERSION }}"
- name: Setup Hugo - name: Setup Hugo
uses: peaceiris/actions-hugo@v2 uses: peaceiris/actions-hugo@v2
with: with:
hugo-version: "latest" hugo-version: "${{ env.HUGO_VERSION }}"
extended: true extended: true
- name: Configure npm - name: Configure npm
run: | run: |
@ -29,16 +48,18 @@ jobs:
npm -g install postcss-cli npm -g install postcss-cli
- name: Install npm packages - name: Install npm packages
run: | run: |
npm install npm ci
- name: Run Hugo - name: Run Hugo
run: | run: |
hugo --environment production --minify hugo --environment production --minify
- name: Deploy to gh-pages - name: Upload artifact
if: ${{ !env.ACT }} uses: actions/upload-pages-artifact@v1
uses: rdarida/simple-github-pages-deploy-action@v1
with: with:
git-user: "MillironX" path: ./public
git-email: "25492070+MillironX@users.noreply.github.com" - name: Deploy to gh-pages
git-base-folder: "public" if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
commit-message: "Build and deploy" uses: peaceiris/actions-gh-pages@v3
branch: "gh-pages" with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
cname: millironx.com