on master help sign in
Fixed image build and use pre-post for cache
commit43a0d9787ee6af5118e48cb7d46cd9257e0c7de4 authoriko <ilyakooo0@gmail.com> dateTue 21 Dec 2021, 19:51 (5 years ago) parent89b190c
3 files changed+12−29
.github/actions/nix_cache/action.yaml+11−9 .github/actions/nix_cache_post/action.yaml−10 .github/workflows/github-actions-image.yaml+1−10
.github/actions/nix_cache/action.yaml+11−9
@@ -14,12 +14,14 @@ runs:
1414 path: |
1515 ~/nix/store
1616 key: ${{ inputs.key }}
17− - name: Move nix cache
18− shell: bash
19− env:
20− CACHE_HIT: ${{ steps.cache-nix.outputs.cache-hit }}
21− run: |
22− if [[ "$CACHE_HIT" == 'true' ]]; then
23− sudo mkdir -p $NIX_STORE
24− sudo mv -f ~/nix/store/* /nix/store/
25− fi
17+ - name: Move nix store
18+ uses: ilyakooo0/github-composite-action-pre-post@1.0.0
19+ with:
20+ pre: |
21+ if [[ -d ~/nix/store ]]; then
22+ sudo mkdir -p /nix/store
23+ sudo mv -f ~/nix/store/* /nix/store/
24+ fi
25+ post: |
26+ mkdir -p ~/nix/store
27+ sudo mv -f /nix/store/* ~/nix/store/
.github/actions/nix_cache_post/action.yamldeleted−10
@@ -1,10 +0,0 @@
1−name: "Nix cache post"
2−description: "Cache nix build post"
3−runs:
4− using: "composite"
5− steps:
6− - name: Move nix cache
7− shell: bash
8− run: |
9− mkdir -p ~/nix/store
10− sudo mv -f /nix/store/* ~/nix/store/
.github/workflows/github-actions-image.yaml+1−10
@@ -52,7 +52,7 @@ jobs:
5252 shell: bash
5353 run: |
5454 cp $(nix-build -A compaRESTGithubAction -j auto) compaREST-Github-Action-image.tar.gz
55− cp $(nix-build -A compaRESTImage-j auto) compaREST-image.tar.gz
55+ cp $(nix-build -A compaRESTImage -j auto) compaREST-image.tar.gz
5656
5757 - name: Upload compaREST Github Action Image
5858 uses: actions/upload-artifact@v2
@@ -114,9 +114,6 @@ jobs:
114114 asset_name: compaREST binary – Linux – x86
115115 tag: ${{ github.ref }}
116116
117− - name: Cache Nix post
118− uses: ./.github/actions/nix_cache_post
119−
120117 macOS:
121118 runs-on: macos-latest
122119 steps:
@@ -152,9 +149,6 @@ jobs:
152149 asset_name: compaREST binary – macOS – x86
153150 tag: ${{ github.ref }}
154151
155− - name: Cache Nix post
156− uses: ./.github/actions/nix_cache_post
157−
158152 Linux-Windows:
159153 runs-on: ubuntu-latest
160154 steps:
@@ -201,6 +195,3 @@ jobs:
201195 file: compaREST
202196 asset_name: compaREST binary – Windows
203197 tag: ${{ github.ref }}
204−
205− - name: Cache Nix post
206− uses: ./.github/actions/nix_cache_post