38 lines
963 B
YAML
38 lines
963 B
YAML
name: build site
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, edited, reopened]
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build_site:
|
|
runs-on: nix
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Build the site
|
|
run: nix-build
|
|
|
|
- name: Pushing site to pages branch
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
run: |
|
|
git switch -C pages
|
|
find . -mindepth 1 -maxdepth 1 ! -name '.domains' ! -name '.git' ! -name 'result' -exec rm -rf {} +
|
|
ls -a
|
|
cp -r result/* .
|
|
rm result
|
|
git add .
|
|
|
|
git config user.name "DGNum Deploy"
|
|
git config user.email "tech@dgnum.eu"
|
|
|
|
git commit --message "Deploy site"
|
|
git push --set-upstream origin pages --force
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: site
|
|
path: ./
|