Skip to content

Commit 330fd01

Browse files
fix: clean enclave-key from workspace
1 parent 7808c6f commit 330fd01

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/workflows/sconify.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ jobs:
100100
prod-mrenclave: ${{ steps.push-prod.outputs.mrenclave }}
101101
prod-checksum: ${{ steps.push-prod.outputs.checksum }}
102102
steps:
103+
- name: Create Temporary Directory
104+
run: mkdir -p ${{github.workspace}}/tmp
105+
103106
- name: Login to Docker Registry
104107
uses: docker/login-action@v3
105108
with:
@@ -153,12 +156,12 @@ jobs:
153156
- name: Sconify Image Prod
154157
if: ${{ inputs.sconify-prod }}
155158
run: |
156-
mkdir -p $HOME/sig
157-
echo "${{ secrets.scone-signing-key }}" > $HOME/sig/enclave-key.pem
159+
mkdir -p ${{github.workspace}}/tmp/sig
160+
echo "${{ secrets.scone-signing-key }}" > ${{github.workspace}}/tmp/sig/enclave-key.pem
158161
docker run \
159162
--rm \
160163
-v /var/run/docker.sock:/var/run/docker.sock \
161-
-v $HOME/sig/enclave-key.pem:/sig/enclave-key.pem \
164+
-v ${{github.workspace}}/tmp/sig/enclave-key.pem:/sig/enclave-key.pem \
162165
registry.scontain.com/scone-production/iexec-sconify-image:${{ inputs.sconify-version }} \
163166
sconify_iexec \
164167
--from=$FROM_IMAGE \
@@ -183,3 +186,7 @@ jobs:
183186
echo "image=$PROD_IMAGE" >> "$GITHUB_OUTPUT"
184187
echo "checksum=0x$(docker image inspect $PROD_IMAGE | jq .[0].RepoDigests[0] | sed 's/"//g' | awk -F '@sha256:' '{print $2}')" >> "$GITHUB_OUTPUT"
185188
echo "mrenclave=$(docker run --rm -e SCONE_HASH=1 $PROD_IMAGE)" >> "$GITHUB_OUTPUT"
189+
190+
- name: Clean Temporary Directory
191+
if: always()
192+
run: rm -rf ${{github.workspace}}/tmp

sconify/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This reusable GitHub Actions workflow automates the process of sconifying a Dock
66

77
The workflow performs the following actions:
88

9+
- **Create Temporary Directory**
910
- **Login to Docker Registry**
1011
- **Login to Scontain Docker Registry**
1112
- **Pull Image to Sconify** from Docker Registry
@@ -14,8 +15,9 @@ The workflow performs the following actions:
1415
- **Sconify Image Debug**
1516
- **Push Debug Image** to Docker Registry and prepare outputs (`debug-image`,`debug-mrenclave`,`debug-checksum`)
1617
- [unless input `sconify-prod: false`]
17-
- **Sconify Image Prod**
18+
- **Sconify Image Prod** using scone-signing-key stored in the Temporary Directory
1819
- **Push Prod Image** to Docker Registry and prepare outputs (`prod-image`,`prod-mrenclave`,`prod-checksum`)
20+
- **Clean Temporary Directory** always
1921

2022
## Workflow Inputs 🛠️
2123

0 commit comments

Comments
 (0)