Skip to content

Commit

Permalink
Updating Github Deploys and Stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinxiel committed Jun 4, 2023
1 parent 74b4ff9 commit f686428
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 15 deletions.
55 changes: 42 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,60 @@ on:
push:
branches:
- main
schedule:
- cron: 0 0 * * *

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2.5.0
with:
hugo-version: 'latest'
extended: true
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: "18.x"

- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}

- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm i
- run: hugo --minify
- run: npm ci
- run: npm run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3.8.0
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
path: "./dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
ssr: false,
ssr: true,
css: ["assets/style.css"],
app: {
head: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
"build": "nuxt build",
"build": "nuxi generate",
"dev": "nuxt dev",
"test": "vitest",
"coverage": "vitest run --coverage",
Expand Down

0 comments on commit f686428

Please sign in to comment.