init
This commit is contained in:
commit
62f99b8a6f
7 changed files with 57 additions and 0 deletions
33
.forgejo/workflows/publish.yaml
Normal file
33
.forgejo/workflows/publish.yaml
Normal file
|
@ -0,0 +1,33 @@
|
|||
on: [push]
|
||||
jobs:
|
||||
test_checkout:
|
||||
runs-on: debian
|
||||
steps:
|
||||
- run: apt-get update -y && apt-get install -y git curl
|
||||
- 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}"
|
||||
hugo
|
||||
- run: |
|
||||
cd dist
|
||||
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