-
-
Notifications
You must be signed in to change notification settings - Fork 325
59 lines (53 loc) · 1.88 KB
/
cron.yml
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
name: "Hourly Build & Deploy to Netlify"
on:
schedule:
- cron: "0 0 * * *"
jobs:
hourly-build-and-deploy:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checking out the repository
uses: actions/checkout@v4
- name: Installing Nix
uses: cachix/install-nix-action@v23
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: nixos-homepage
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: Update content
run: |
bash ./scripts/update.sh
- name: Building nixos.org
run: |
nix build
mkdir build
cp -RL ./result/* ./result/.well-known/ ./build/
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2.1.0
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
production-branch: "master"
production-deploy: true
publish-dir: "./build"
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
enable-commit-comment: true
enable-commit-status: true
overwrites-pull-request-comment: false
if: github.repository == 'NixOS/nixos-homepage'
- name: Commit updated files and push them to master branch
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Hourly update [ci skip]"
branch: "master"
file_pattern: flake.lock blog/announcements.xml
commit_user_name: NixOS webmaster
commit_user_email: webmaster@nixos.org
commit_author: GitHub Actions <webmaster@nixos.org>
if: github.repository == 'NixOS/nixos-homepage'