Skip to content

Commit 0bbe315

Browse files
committed
removed unused inputs, added cleanup job
1 parent e11858d commit 0bbe315

File tree

3 files changed

+44
-12
lines changed

3 files changed

+44
-12
lines changed

.github/workflows/build_template.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: Build Template
33
on:
44
workflow_call:
55
secrets:
6-
E2B_API_KEY:
7-
required: true
86
E2B_ACCESS_TOKEN:
97
required: true
108
DOCKERHUB_USERNAME:
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Cleanup Build Template
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
E2B_ACCESS_TOKEN:
7+
required: true
8+
DOCKERHUB_USERNAME:
9+
required: true
10+
inputs:
11+
E2B_DOMAIN:
12+
required: false
13+
type: string
14+
E2B_CI_TEMPLATE:
15+
required: true
16+
type: string
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
cleanup:
23+
name: Cleanup Build Template
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Install E2B CLI
27+
run: npm install -g @e2b/cli
28+
29+
- name: Cleanup E2B template
30+
id: cleanup-template
31+
run: |
32+
e2b template delete --team "460355b3-4f64-48f9-9a16-4442817f79f5" ${{ inputs.E2B_CI_TEMPLATE }}
33+
env:
34+
E2B_ACCESS_TOKEN: ${{ secrets.E2B_ACCESS_TOKEN }}
35+
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}

.github/workflows/pull_request.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
build-template:
1818
uses: ./.github/workflows/build_template.yml
1919
secrets:
20-
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
2120
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
2221
E2B_ACCESS_TOKEN: ${{ secrets.E2B_ACCESS_TOKEN }}
2322
with:
@@ -40,14 +39,14 @@ jobs:
4039
with:
4140
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
4241
E2B_CI_TEMPLATE: ${{ needs.build-template.outputs.template_id }}
43-
# cleanup-build-template:
44-
# uses: ./.github/workflows/cleanup_build_template.yml
45-
# needs: [build-template, js-sdk, python-sdk]
46-
# if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
47-
# secrets:
48-
# E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
49-
# E2B_ACCESS_TOKEN: ${{ secrets.E2B_ACCESS_TOKEN }}
50-
# inputs:
51-
# E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
42+
cleanup-build-template:
43+
uses: ./.github/workflows/cleanup_build_template.yml
44+
needs: [build-template, js-sdk, python-sdk]
45+
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
46+
secrets:
47+
E2B_ACCESS_TOKEN: ${{ secrets.E2B_ACCESS_TOKEN }}
48+
inputs:
49+
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
50+
E2B_CI_TEMPLATE: ${{ needs.build-template.outputs.template_id }}
5251
charts-tests:
5352
uses: ./.github/workflows/charts_tests.yml

0 commit comments

Comments
 (0)