|
1 | 1 | jobs: |
2 | | - _2_push_to_cachix: |
3 | | - name: Push to cachix |
4 | | - runs-on: ${{ matrix.os }} |
5 | | - steps: |
6 | | - - name: Checkout this repo |
7 | | - uses: actions/checkout@v3 |
8 | | - - name: Install Nix |
9 | | - uses: cachix/install-nix-action@v18 |
10 | | - with: |
11 | | - extra_nix_config: "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}\nsubstituters = https://cache.nixos.org/ https://cache.iog.io https://nix-community.cachix.org https://deemp.cachix.org \ntrusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8= deemp.cachix.org-1:9shDxyR2ANqEPQEEYDL/xIOnoPwxHot21L5fiZnFL18=\n" |
12 | | - install_url: https://releases.nixos.org/nix/nix-2.11.1/install |
13 | | - - name: Log in to Cachix |
14 | | - uses: cachix/cachix-action@v12 |
15 | | - with: |
16 | | - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} |
17 | | - name: ${{ secrets.CACHIX_CACHE }} |
18 | | - - env: |
19 | | - CACHIX_CACHE: ${{ secrets.CACHIX_CACHE }} |
20 | | - name: Push flakes to Cachix |
21 | | - run: nix run .#pushToCachix |
22 | | - strategy: |
23 | | - matrix: |
24 | | - os: |
25 | | - - macos-11 |
26 | | - - macos-12 |
27 | | - - ubuntu-20.04 |
28 | | - - ubuntu-22.04 |
29 | | - _3_front: |
| 2 | + _1_front: |
30 | 3 | name: Publish front |
31 | | - runs-on: ubuntu-20.04 |
| 4 | + runs-on: ubuntu-22.04 |
32 | 5 | steps: |
33 | 6 | - name: Checkout this repo |
34 | 7 | uses: actions/checkout@v3 |
35 | 8 | - name: Install Nix |
36 | | - uses: cachix/install-nix-action@v18 |
| 9 | + uses: nixbuild/nix-quick-install-action@v25 |
| 10 | + with: |
| 11 | + nix_conf: | |
| 12 | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} |
| 13 | + substituters = https://cache.nixos.org/ https://nix-community.cachix.org https://cache.iog.io https://deemp.cachix.org |
| 14 | + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= deemp.cachix.org-1:9shDxyR2ANqEPQEEYDL/xIOnoPwxHot21L5fiZnFL18= |
| 15 | + keep-outputs = true |
| 16 | + - name: Restore and cache Nix store |
| 17 | + uses: nix-community/cache-nix-action@v1 |
37 | 18 | with: |
38 | | - extra_nix_config: "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}\nsubstituters = https://cache.nixos.org/ https://cache.iog.io https://nix-community.cachix.org https://deemp.cachix.org \ntrusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8= deemp.cachix.org-1:9shDxyR2ANqEPQEEYDL/xIOnoPwxHot21L5fiZnFL18=\n" |
39 | | - install_url: https://releases.nixos.org/nix/nix-2.11.1/install |
| 19 | + key: nix-${{ runner.os }}-front-${{ hashfiles('**/flake.nix', '**/flake.lock') }} |
| 20 | + restore-keys: | |
| 21 | + nix-${{ runner.os }}-front-${{ hashfiles('**/flake.nix', '**/flake.lock') }} |
| 22 | + nix-${{ runner.os }}-front- |
40 | 23 | - name: Build |
41 | | - run: | |
| 24 | + run: |- |
| 25 | + ROOT_DIR=$PWD |
42 | 26 | cd front |
| 27 | + nix profile install .#buildGHPages |
43 | 28 | nix run .#buildGHPages |
| 29 | + cd $ROOT_DIR |
44 | 30 | - name: GitHub Pages action |
45 | 31 | uses: peaceiris/actions-gh-pages@v3.9.0 |
46 | 32 | with: |
47 | 33 | force_orphan: true |
48 | 34 | github_token: ${{ secrets.GITHUB_TOKEN }} |
49 | 35 | publish_dir: ./front/docs |
50 | | - _4_back: |
| 36 | + _2_back: |
51 | 37 | name: Publish back |
52 | | - runs-on: ubuntu-20.04 |
| 38 | + runs-on: ubuntu-22.04 |
53 | 39 | steps: |
54 | 40 | - name: Checkout this repo |
55 | 41 | uses: actions/checkout@v3 |
56 | 42 | - name: Install Nix |
57 | | - uses: cachix/install-nix-action@v18 |
| 43 | + uses: nixbuild/nix-quick-install-action@v25 |
| 44 | + with: |
| 45 | + nix_conf: | |
| 46 | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} |
| 47 | + substituters = https://cache.nixos.org/ https://nix-community.cachix.org https://cache.iog.io https://deemp.cachix.org |
| 48 | + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= deemp.cachix.org-1:9shDxyR2ANqEPQEEYDL/xIOnoPwxHot21L5fiZnFL18= |
| 49 | + keep-outputs = true |
| 50 | + - name: Restore and cache Nix store |
| 51 | + uses: nix-community/cache-nix-action@v1 |
58 | 52 | with: |
59 | | - extra_nix_config: "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}\nsubstituters = https://cache.nixos.org/ https://cache.iog.io https://nix-community.cachix.org https://deemp.cachix.org \ntrusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8= deemp.cachix.org-1:9shDxyR2ANqEPQEEYDL/xIOnoPwxHot21L5fiZnFL18=\n" |
60 | | - install_url: https://releases.nixos.org/nix/nix-2.11.1/install |
| 53 | + key: nix-${{ runner.os }}-back-${{ hashfiles('**/flake.nix', '**/flake.lock') }} |
| 54 | + restore-keys: | |
| 55 | + nix-${{ runner.os }}-back-${{ hashfiles('**/flake.nix', '**/flake.lock') }} |
| 56 | + nix-${{ runner.os }}-back- |
61 | 57 | - name: Log in to Heroku |
62 | 58 | uses: AkhileshNS/heroku-deploy@master |
63 | 59 | with: |
|
66 | 62 | heroku_email: ${{ secrets.HEROKU_EMAIL }} |
67 | 63 | justlogin: true |
68 | 64 | - name: Release app on Heroku |
69 | | - run: | |
| 65 | + run: |- |
| 66 | + ROOT_DIR=$PWD |
70 | 67 | cd back |
| 68 | + nix profile install .#herokuRelease |
71 | 69 | nix run .#herokuRelease |
| 70 | + cd $ROOT_DIR |
| 71 | + _3_purge_caches: |
| 72 | + name: Purge cache |
| 73 | + needs: |
| 74 | + - _1_front |
| 75 | + - _2_back |
| 76 | + runs-on: ubuntu-22.04 |
| 77 | + steps: |
| 78 | + - name: Purge cache |
| 79 | + uses: deemp/purge-cache@v1 |
| 80 | + with: |
| 81 | + accessed: true |
| 82 | + created: true |
| 83 | + debug: true |
| 84 | + max-age: 172800 |
72 | 85 | name: Nix CI |
73 | 86 | "on": |
74 | 87 | pull_request: {} |
|
0 commit comments