/
deka
/
buffer
Обзор
Документация
Войти
/
deka
/
buffer
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
.gitverse/workflows/release.yaml
105 строк
3 KB
Maksim Ratnikov
ci: deploy lab with GitVerse Pages workflow
12 май 2026, 15:13
12 май 2026, 15:13
8b7dd41
Код
Авторство
О чём код?
name: Release lab to master and Pages # Rebuilds lab/wiki-clipboard-lab.html on every push to dev and writes the # resulting single-file artifact to master/index.html. It also deploys the # same file through GitVerse Pages actions. In repository settings, # Pages must use Source = "Воркфлоу" for the deploy step to publish the site. # # Push credentials are set up automatically by actions/checkout — same pattern # as the official Maven CI tutorial in /docs/cicd/manuals/maven. No personal # access token or remote URL rewrite is needed. on: push: branches: [dev] workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - name: Checkout dev uses: actions/checkout@v4 with: ref: dev fetch-depth: 0 - name: Setup Node uses: actions/setup-node@v4 with: node-version: "20" - name: Build lab run: node tools/build-lab.mjs - name: Verify build is fresh run: node tests/build-lab-fresh.test.mjs - name: Run structural tests run: node tests/wiki-clipboard-lab.test.mjs - name: Push artifact to master run: | set -euo pipefail git config user.name "gitverse-ci" git config user.email "cicd@gitverse.local" DEV_SHORT=$(git rev-parse --short HEAD) DEV_MSG=$(git log -1 --pretty=%s) ARTIFACT=$(mktemp /tmp/wcl-build-XXXXXX.html) cp lab/wiki-clipboard-lab.html "$ARTIFACT" git fetch origin master WORKTREE=$(mktemp -d /tmp/release-master-XXXXXX) git worktree add "$WORKTREE" origin/master ( cd "$WORKTREE" git switch -C master cp "$ARTIFACT" index.html if git diff --quiet -- index.html; then echo "No artifact changes; skipping release commit." exit 0 fi git add index.html git commit -m "release: ${DEV_SHORT} ${DEV_MSG}" git push origin master ) git worktree remove --force "$WORKTREE" || true rm -f "$ARTIFACT" - name: Prepare Pages artifact run: | set -euo pipefail mkdir -p pages-artifact cp lab/wiki-clipboard-lab.html pages-artifact/index.html - name: Upload Pages artifact uses: actions/upload-pages-artifact@v1 with: path: pages-artifact deploy: needs: build runs-on: ubuntu-latest steps: - name: Setup Go uses: actions/setup-go@v4 with: go-version: ">=1.23" - name: Deploy Pages id: deployment uses: actions/deploy-pages@v1 with: artifact_name: gitverse-pages - name: Print deploy URL run: echo "page_url = ${{ steps.deployment.outputs.page_url }}"