Build Systems #732
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: "Build Systems" | |
on: | |
schedule: | |
- cron: '0 15 * * *' | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Maximize space | |
run: | | |
bash .github/scripts/cleanup.sh | |
- name: Install nixFlake | |
uses: cachix/install-nix-action@v20 | |
with: | |
extra_nix_config: | | |
experimental-features = nix-command flakes | |
extra-trusted-public-keys = nixos-cn.cachix.org-1:L0jEaL6w7kwQOPlLoCR3ADx+E3Q8SEFEcB9Jaibl0Xg= emerge.cachix.org-1:Zvw8m0TXudK0MtylBFvUZCUEHlOfTgfvE2bbIexGhVw= | |
extra-substituters = https://nixos-cn.cachix.org https://emerge.cachix.org | |
- uses: cachix/cachix-action@v14 | |
with: | |
name: emerge | |
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
- name: Configure git | |
run: | | |
git config --global user.name 'Automation - Ninlives' | |
git config --global user.email 'wqseleven@gmail.com' | |
- name: Update dependencies | |
run: | | |
eval $(ssh-agent) | |
echo "${{ secrets.VALUES_SSH_KEY }}"|ssh-add - | |
nix flake update | |
- name: Build system | |
run: nix build .#nixosConfigurations.lego.config.system.build.toplevel --print-build-logs --show-trace | |
- name: Build terraform configuration | |
run: nix build .#terraformConfigurations.zero --print-build-logs --show-trace | |
- name: Commit if build succeed | |
run: | | |
git diff-index --quiet HEAD \ | |
|| (git commit -am "Update dependencies - Automated Commit" && git push || git stash) | |