Skip to content

Commit

Permalink
Merge pull request NixOS#403 from NixOS/update-nixpkgs-on-cron
Browse files Browse the repository at this point in the history
Update flake.lock in cronjob
  • Loading branch information
garbas authored May 2, 2020
2 parents 47ac357 + 8beb284 commit 2649c0a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,30 @@ on:
schedule:
- cron: '0 * * * *'
jobs:
build-and-deploy:
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@v8
- name: Installing NixFlakes
run: |
nix-env -iA nixpkgs.nixFlakes
echo "::add-path::$HOME/.nix-profile/bin"
echo 'experimental-features = nix-command flakes' | sudo tee -a /etc/nix/nix.conf
nix --version
cat /etc/nix/nix.conf
- name: Update content
run: ./update.sh
- name: Building nixos.org
run: nix-build && mkdir build && cp -RL ./result/* ./build/
run: |
nix build
mkdir build
cp -RL ./result/* ./build/
- name: Deploy to Netlify
uses: nwtgck/[email protected]
env:
Expand All @@ -26,4 +37,11 @@ jobs:
production-branch: 'master'
deploy-message: 'Deploy from GitHub Actions'
if: github.repository == 'NixOS/nixos-homepage'

- name: Commit flake.lock, blogs.xml and push to master branch
uses: github-actions-x/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: 'master'
commit-message: 'Update flake.lock and blogs.xml [ci skip]'
files: flake.lock blogs.xml
if: github.repository == 'NixOS/nixos-homepage'
13 changes: 12 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,28 @@ on:
jobs:
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@v8
- name: Installing NixFlakes
run: |
nix-env -iA nixpkgs.nixFlakes
echo "::add-path::$HOME/.nix-profile/bin"
echo 'experimental-features = nix-command flakes' | sudo tee -a /etc/nix/nix.conf
nix --version
cat /etc/nix/nix.conf
- name: Update content
run: ./update.sh
- name: Building nixos.org
run: nix-build && mkdir build && cp -RL ./result/* ./build/
run: |
nix build
mkdir build
cp -RL ./result/* ./build/
- name: Deploy to Netlify
uses: nwtgck/[email protected]
env:
Expand Down
8 changes: 6 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#! /bin/sh

UPDATE=1 nix run nixpkgs#gnumake nixpkgs#curl -c make update --keep-going || true
set -e

nix flake update --update-input released-nixpkgs || true
UPDATE=1 nix run nixpkgs#gnumake nixpkgs#curl -c make update --keep-going

nix flake update \
--update-input released-nixpkgs \
--update-input nix-pills

0 comments on commit 2649c0a

Please sign in to comment.