Skip to content

Commit 69d11f5

Browse files
committed
populate secrets
1 parent 072d967 commit 69d11f5

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

.github/workflows/build-notebooks-TEMPLATE.yaml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,27 @@ jobs:
6565

6666
- run: mkdir -p $TMPDIR
6767

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+
6889
# for bin/buildinputs in scripts/sandbox.py
6990
- uses: actions/setup-go@v5
7091
with:
@@ -255,23 +276,6 @@ jobs:
255276

256277
# region Image build
257278

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-
275279
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
276280
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
277281

0 commit comments

Comments
 (0)