|
65 | 65 |
|
66 | 66 | - run: mkdir -p $TMPDIR
|
67 | 67 |
|
| 68 | + # do this early because it's fast and why not |
| 69 | + - name: Unlock encrypted secrets with git-crypt |
| 70 | + if: ${{ inputs.subscription }} |
| 71 | + run: | |
| 72 | + sudo apt-get update |
| 73 | + sudo apt-get install git-crypt |
| 74 | + echo "${GIT_CRYPT_KEY}" | base64 --decode > ./git-crypt-key |
| 75 | + git-crypt unlock ./git-crypt-key |
| 76 | + rm ./git-crypt-key |
| 77 | + env: |
| 78 | + GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY }} |
| 79 | + |
| 80 | + - name: Add subscriptions from GitHub secret |
| 81 | + if: ${{ inputs.subscription }} |
| 82 | + run: | |
| 83 | + sudo cp -R ${PWD}/ci/secrets/pki/* /etc/pki/ |
| 84 | + printf "${PWD}/ci/secrets/pki/consumer:/etc/pki/consumer\n${PWD}/ci/secrets/pki/entitlement:/etc/pki/entitlement" | sudo tee /usr/share/containers/mounts.conf |
| 85 | +
|
| 86 | + mkdir -p $HOME/.config/containers/ |
| 87 | + sudo cp ${PWD}/ci/secrets/pull-secret.txt $HOME/.config/containers/auth.json |
| 88 | +
|
68 | 89 | # for bin/buildinputs in scripts/sandbox.py
|
69 | 90 | - uses: actions/setup-go@v5
|
70 | 91 | with:
|
@@ -255,23 +276,6 @@ jobs:
|
255 | 276 |
|
256 | 277 | # region Image build
|
257 | 278 |
|
258 |
| - - name: Unlock encrypted secrets with git-crypt |
259 |
| - if: ${{ inputs.subscription }} |
260 |
| - run: | |
261 |
| - sudo apt-get update |
262 |
| - sudo apt-get install git-crypt |
263 |
| - echo "${GIT_CRYPT_KEY}" | base64 --decode > ./git-crypt-key |
264 |
| - git-crypt unlock ./git-crypt-key |
265 |
| - rm ./git-crypt-key |
266 |
| - env: |
267 |
| - GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY }} |
268 |
| - |
269 |
| - - name: Add subscriptions from GitHub secret |
270 |
| - if: ${{ inputs.subscription }} |
271 |
| - run: | |
272 |
| - printf "${PWD}/ci/secrets/pki/consumer:/etc/pki/consumer\n${PWD}/ci/secrets/pki/entitlement:/etc/pki/entitlement" > /usr/share/containers/mounts.conf |
273 |
| - cp ${PWD}/ci/secrets/pull-secret.txt $HOME/.config/containers/auth.json |
274 |
| -
|
275 | 279 | # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
|
276 | 280 | # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
|
277 | 281 |
|
|
0 commit comments