-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 2.19 KB
/
main.yml
File metadata and controls
63 lines (54 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v13
- uses: cachix/cachix-action@v10
with:
name: layus
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
# Only needed for private caches
#authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build
run: |
nix-build
nix-shell --command "./result/bin/site build"
- name: Propagate changes to 'static' branch
run: |
git checkout static
rsync -a --filter='P _site/' --filter='P _cache/' --filter='P .git/' --filter='P .gitignore' --filter='P CNAME' --filter='P .github/' --filter='P .stack-work' --filter='P result' --filter='P site' --delete-excluded _site/ .
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit --allow-empty -m "Automatic updates from https://github.com/layus/layus.github.io/commit/${GITHUB_SHA}"
- name: Release to 'static'
if: ${{ github.event_name == 'push' }}
uses: ad-m/github-push-action@v0.6.0
with:
# Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }}
github_token: "${{ secrets.GITHUB_TOKEN }}"
# Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})
#repository: ${GITHUB_REPOSITORY}
# Destination branch to push changes
branch: static
# Determines if force push is used
force: false
# Determines if --tags is used
tags: false
# Directory to change to before pushing.
#directory: None