This commit is contained in:
parent
96d1c68977
commit
67e1c31bd4
11 changed files with 77 additions and 37 deletions
34
.forgejo/workflows/publish.yaml
Normal file
34
.forgejo/workflows/publish.yaml
Normal file
|
@ -0,0 +1,34 @@
|
|||
on: [push]
|
||||
jobs:
|
||||
test_checkout:
|
||||
runs-on: debian
|
||||
steps:
|
||||
- run: apt-get update -y && apt-get install -y git curl pdf2svg
|
||||
- run: |
|
||||
curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.124.1/hugo_extended_0.124.1_linux-amd64.deb
|
||||
dpkg -i ./hugo_extended_0.124.1_linux-amd64.deb
|
||||
- run: |
|
||||
TOKEN=$(echo -n "x-access-token:${GITHUB_TOKEN}" | base64)
|
||||
mkdir -p "${GITHUB_WORKSPACE}"
|
||||
cd "${GITHUB_WORKSPACE}"
|
||||
git init
|
||||
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
|
||||
git -c http.extraHeader="Authorization: Basic ${TOKEN}" fetch origin "${GITHUB_SHA}"
|
||||
git checkout "${GITHUB_SHA}"
|
||||
git submodule update --init --recursive
|
||||
- run: |
|
||||
cd "${GITHUB_WORKSPACE}"
|
||||
pdf2svg content/cv.pdf content/cv.svg
|
||||
hugo --minify
|
||||
- run: |
|
||||
cd "${GITHUB_WORKSPACE}/public/"
|
||||
git init
|
||||
git config user.email "ci_action@example.com"
|
||||
git config user.name "CI"
|
||||
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
|
||||
TOKEN=$(echo -n "x-access-token:${GITHUB_TOKEN}" | base64)
|
||||
git -c http.extraHeader="Authorization: Basic ${TOKEN}" push origin -d pages || true
|
||||
git checkout -b pages
|
||||
git add *
|
||||
git commit -m "gen pages"
|
||||
git -c http.extraHeader="Authorization: Basic ${TOKEN}" push -u origin pages
|
Loading…
Add table
Add a link
Reference in a new issue