Skip to content

Commit

Permalink
ci: update actions and use attic-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
soopyc committed Apr 20, 2024
1 parent 06df99f commit a156ab9
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,43 +37,28 @@ jobs:
matrix:
host:
- koumakan
- satori

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Write Nix netrc file
run: |
sudo mkdir -p /etc/nix
echo "machine nonbunary.soopy.moe password ${access_token}" | sudo tee /etc/nix/netrc > /dev/null
env:
access_token: ${{ secrets.ATTIC_ACCESS_TOKEN }}
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
uses: DeterminateSystems/nix-installer-action@v10
with:
extra-conf: |
fallback = true # why is this not the default?
fallback = true # why is this not the default?
connect-timeout = 30
netrc-file = /etc/nix/netrc
experimental-features = nix-command flakes
extra-substituters = https://nonbunary.soopy.moe/gensokyo-systems https://nonbunary.soopy.moe/gensokyo-global
extra-trusted-public-keys = gensokyo-systems:r/Wx649dPuQrCN9Pgh3Jic526zQNk3oWMqYJHnob/Ok= gensokyo-global:XiCN0D2XeSxF4urFYTprR+1Nr/5hWyydcETwZtPG6Ec=
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Replace .cry files with some bollocks
run: find . -name "*.cry" -execdir bash -c 'echo some bollocks > {}' \;
- name: Setup attic cache
uses: ryanccn/attic-action
with:
endpoint: https://nonbunary.soopy.moe
cache: gensokyo-systems
token: ${{ secrets.ATTIC_TOKEN }}
skip-push: ${{ github.event_name == 'pull_request' }}

- name: Build configuration
run: nix build .#nixosConfigurations."${{ matrix.host }}".config.system.build.toplevel

- name: Setup attic and push to cache
if: ${{ github.event_name != 'pull_request' }}
run: |
nix run github:zhaofengli/attic#default login nbsm https://nonbunary.soopy.moe ${access_token}
nix run github:zhaofengli/attic#default push gensokyo-systems result
env:
access_token: ${{ secrets.ATTIC_ACCESS_TOKEN }}
continue-on-error: true

0 comments on commit a156ab9

Please sign in to comment.