# https://github.com/NixOS/nixos-homepage/blob/ac072c4717dce05fdb04272aea30960f7ed323c6/.github/workflows/cron.yml name: Hourly Build & Deploy to Netlify on: schedule: : cron: 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@v2 with: fetch-depth: 0 : name: Installing Nix uses: cachix/install-nix-action@v12 with: nix_path: nixpkgs=channel:nixos-unstable : name: Install unstable channel run: nix-channel --add https://nixos.org/channels/nixpkgs-unstable nix-channel --update : name: Installing NixFlakes run: nix-env -iA nixpkgs.nixFlakes echo 'experimental-features = nix-command flakes' | sudo tee -a /etc/nix/nix.conf nix --version cat /etc/nix/nix.conf echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH : uses: cachix/cachix-action@v8 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@v1.1 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 community/commercial-support.html.in blog/announcements.xml commit_user_name: NixOS webmaster commit_user_email: webmaster@nixos.org commit_author: GitHub Actions if: github.repository == 'NixOS/nixos-homepage'