mirror of
https://github.com/zoriya/astal.git
synced 2026-05-26 07:39:27 +00:00
539a6b4cc1
only push if there are changes
61 lines
1.4 KiB
YAML
61 lines
1.4 KiB
YAML
name: Deploy GI docs
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: write
|
|
pages: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
gi-docs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Nix
|
|
uses: DeterminateSystems/nix-installer-action@main
|
|
with:
|
|
logger: pretty
|
|
|
|
- name: Checkout Source Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: src
|
|
|
|
- name: Build Documentation
|
|
run: |
|
|
cd src
|
|
nix build .#docs --print-build-logs
|
|
|
|
- name: Checkout Destination Repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.token }}
|
|
repository: aylur/aylur.github.io
|
|
ref: main
|
|
path: dist
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
git config --global user.name "GitHub Actions Bot"
|
|
|
|
- name: Clean and Copy Files
|
|
run: |
|
|
rm -rf dist/libastal
|
|
cp -r src/result/libastal dist/libastal
|
|
|
|
- name: Check for Changes
|
|
run: |
|
|
cd dist
|
|
|
|
- name: Push to Pages Repo
|
|
run: |
|
|
cd dist
|
|
git add .
|
|
if [ -n "$(git diff --cached)" ]; then
|
|
git commit -m "Deployed from https://github.com/${{ github.repository }}/commit/${{ github.sha }}"
|
|
git push origin main
|
|
fi
|