Skip to content

Daily Build & Deploy to Netlify #29230

Daily Build & Deploy to Netlify

Daily Build & Deploy to Netlify #29230

Workflow file for this run

name: "Daily Build & Deploy to Netlify"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
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@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
# Pin Nix so that CI doesn't randomly break again
# And we don't want 2.19.1 because that doesn't have backwards compatible support for --update-input
install_url: https://releases.nixos.org/nix/nix-2.19.2/install
- name: Setup Cachix
uses: cachix/cachix-action@v14
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: "Daily 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'