Daily Build & Deploy to Netlify #28920
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
- name: Installing Nix | |
uses: cachix/install-nix-action@v22 | |
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/[email protected] | |
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@v4 | |
with: | |
commit_message: "Hourly update [ci skip]" | |
branch: "master" | |
file_pattern: flake.lock blog/announcements.xml | |
commit_user_name: NixOS webmaster | |
commit_user_email: [email protected] | |
commit_author: GitHub Actions <[email protected]> | |
if: github.repository == 'NixOS/nixos-homepage' |