base setup

This commit is contained in:
Jacky Zhao 2023-05-28 17:44:08 -07:00
parent 7b1da7a845
commit a757521313
74 changed files with 3015 additions and 3751 deletions

View file

@ -3,37 +3,38 @@ name: Deploy to GitHub Pages
on:
push:
branches:
- hugo
- v4-alpha
jobs:
deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
fetch-depth: 0
- name: Build Link Index
uses: jackyzha0/hugo-obsidian@v2.20
- name: Setup Node
uses: actions/setup-node@v3
with:
index: true
input: content
output: assets/indices
root: .
node-version: '18'
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
- name: Cache dependencies
uses: actions/cache@v3
with:
hugo-version: '0.96.0'
extended: true
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build
run: hugo --minify
- run: npm ci
- name: Build Quartz
run: npx quartx build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: master # deploying branch
cname: quartz.jzhao.xyz

View file

@ -1,42 +0,0 @@
name: Create and publish a Docker image
on:
push:
branches: ['hugo']
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
if: github.repository == 'jackyzha0/quartz'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}