Skip to content

Commit bc0d2fb

Browse files
author
Skylar Simoncelli
committed
feat: inputs
1 parent 75277ca commit bc0d2fb

File tree

2 files changed

+13
-28
lines changed

2 files changed

+13
-28
lines changed

.github/workflows/cicd.yml

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Build, test, release and deploy
22

3+
permissions:
4+
id-token: write
5+
contents: write
6+
37
on:
48
workflow_dispatch:
59
inputs:
@@ -47,9 +51,6 @@ jobs:
4751
local-environment-tests:
4852
needs: [build-pc-artifacts, partner-chains-smart-contracts]
4953
uses: ./.github/workflows/modules/local-environment-tests.yml
50-
permissions:
51-
id-token: write
52-
contents: write
5354
with:
5455
tag: ${{ inputs.tag }}
5556
image: ${{ secrets.ECR_REGISTRY_SECRET }}/substrate-node:${{ inputs.sha }}
@@ -156,26 +157,19 @@ jobs:
156157
chain-specs:
157158
needs: build-pc-artifacts
158159
uses: ./.github/workflows/modules/chain-specs.yml
159-
permissions:
160-
id-token: write
161-
contents: write
162160
with:
163161
sha: ${{ inputs.sha }}
164162
tag: ${{ inputs.tag }}
165163

166164
deploy-staging-preview:
167165
needs: chain-specs
168166
uses: ./.github/workflows/modules/staging-preview-deploy.yml
169-
permissions:
170-
id-token: write
171-
contents: write
172167
with:
173168
image: ${{ secrets.ECR_REGISTRY_SECRET }}/substrate-node:${{ inputs.sha }}
174169
chain-spec-secret: staging-chain-spec-${{ inputs.sha }}
175170

176171
build-and-publish-ghcr-image:
177172
uses: ./.github/workflows/modules/build-and-publish-ghcr-image.yml
178173
with:
179-
commit_sha: ${{ inputs.sha }}
180-
ghcr_tag: ${{ inputs.tag }}
181-
publish_to_ghcr: true
174+
sha: ${{ inputs.sha }}
175+
tag: ${{ inputs.tag }}

.github/workflows/modules/build-and-publish-ghcr-image.yml

+7-16
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,24 @@ name: Build and Publish to GHCR
33
on:
44
workflow_call:
55
inputs:
6-
commit_sha:
6+
sha:
77
description: 'Commit SHA to build from'
88
required: true
99
type: string
10-
ghcr_tag:
10+
tag:
1111
description: "Tag for GHCR image"
1212
required: true
1313
type: string
14-
publish_to_ghcr:
15-
description: "Publish to GitHub Container Registry"
16-
default: true
17-
type: boolean
1814
workflow_dispatch:
1915
inputs:
20-
commit_sha:
16+
sha:
2117
description: 'Commit SHA to build from'
2218
required: true
2319
type: string
24-
ghcr_tag:
20+
tag:
2521
description: "Tag for GHCR image"
2622
required: true
2723
type: string
28-
publish_to_ghcr:
29-
description: "Publish to GitHub Container Registry"
30-
default: true
31-
type: boolean
3224

3325
env:
3426
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
@@ -44,7 +36,7 @@ jobs:
4436
- name: Checkout
4537
uses: actions/checkout@v4
4638
with:
47-
ref: ${{ inputs.commit_sha }}
39+
ref: ${{ inputs.sha }}
4840

4941
- name: Setup Earthly
5042
uses: ./.github/earthly-setup
@@ -112,7 +104,6 @@ jobs:
112104
done
113105
114106
- name: Main Build
115-
if: ${{ inputs.publish_to_ghcr }}
116107
env:
117108
EARTHLY_CI: true
118109
EARTHLY_PUSH: false
@@ -134,8 +125,8 @@ jobs:
134125
run: |
135126
repository_name="${GITHUB_REPOSITORY##*/}"
136127
target_image="ghcr.io/${{ github.repository }}/$repository_name-node"
137-
commit_sha="${{ inputs.commit_sha }}"
138-
custom_tag="${{ inputs.ghcr_tag }}"
128+
commit_sha="${{ inputs.sha }}"
129+
custom_tag="${{ inputs.tag }}"
139130
140131
docker tag ghcr-image:latest $target_image:latest
141132
docker tag ghcr-image:latest $target_image:$commit_sha

0 commit comments

Comments
 (0)