2024-03-13 16:39:21 +01:00
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
|
|
test_checkout:
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
|
|
|
image: rust:slim-bookworm
|
|
|
|
steps:
|
2024-03-14 17:03:29 +01:00
|
|
|
- run: apt-get update -y && apt-get install -y git curl
|
2024-03-13 17:35:57 +01:00
|
|
|
- run: |
|
|
|
|
curl -L https://github.com/trunk-rs/trunk/releases/download/v0.19.1/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
|
|
|
|
mv trunk /
|
2024-03-13 17:29:39 +01:00
|
|
|
- run: rustup target add wasm32-unknown-unknown
|
2024-03-14 17:03:29 +01:00
|
|
|
- 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}"
|
2024-03-13 17:37:07 +01:00
|
|
|
- run: /trunk build --release --public-url '.'
|
2024-03-13 16:39:21 +01:00
|
|
|
- run: |
|
|
|
|
cd dist
|
|
|
|
git init
|
2024-03-13 17:48:17 +01:00
|
|
|
git config user.email "ci_action@example.com"
|
|
|
|
git config user.name "CI"
|
2024-03-13 17:44:21 +01:00
|
|
|
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
|
2024-03-13 16:39:21 +01:00
|
|
|
TOKEN=$(echo -n "x-access-token:${GITHUB_TOKEN}" | base64)
|
2024-03-13 17:53:00 +01:00
|
|
|
git -c http.extraHeader="Authorization: Basic ${TOKEN}" push origin -d pages || true
|
2024-03-13 16:39:21 +01:00
|
|
|
git checkout -b pages
|
|
|
|
git add *
|
|
|
|
git commit -m "gen pages"
|
|
|
|
git -c http.extraHeader="Authorization: Basic ${TOKEN}" push -u origin pages
|