Skip to content

Commit

Permalink
feat: inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Skylar Simoncelli committed Sep 18, 2024
1 parent eeaf719 commit 75277ca
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 23 deletions.
44 changes: 30 additions & 14 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
name: Build, test, release and deploy
name: Build, test, release and deploy

on:
workflow_dispatch:
inputs:
sha:
description: "partner-chains commit SHA or branch to build from"
description: "partner-chains commit SHA to build from"
required: true
type: string
tag:
description: "partner-chains release tag"
required: true
type: string

env:
AWS_REGION: "eu-central-1"
SSH_AUTH_SOCK: /tmp/ssh_agent.sock

jobs:
build-pc-artifacts:
uses: ./.github/workflows/modules/build-pc-artifacts.yml
with:
sha: ${{ inputs.sha }}
tag: ${{ inputs.tag }}
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/modules/build-pc-artifacts.yml
with:
sha: ${{ inputs.sha }}
tag: ${{ inputs.tag }}

publish-ecr-image:
build-and-publish-ecr-image:
needs: build-pc-artifacts
uses: ./.github/workflows/modules/build-and-publish-ecr-image.yml
with:
sha: ${{ inputs.sha }}
tag: ${{ inputs.tag }}
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/modules/build-and-publish-ecr-image.yml
with:
sha: ${{ inputs.sha }}
tag: ${{ inputs.tag }}

partner-chains-smart-contracts:
uses: ./.github/workflows/modules/download-pcsc-artifact.yml
Expand All @@ -38,8 +45,11 @@ jobs:
# sha: #TODO

local-environment-tests:
needs: [partner-chains-linux, partner-chains-smart-contracts]
needs: [build-pc-artifacts, partner-chains-smart-contracts]
uses: ./.github/workflows/modules/local-environment-tests.yml
permissions:
id-token: write
contents: write
with:
tag: ${{ inputs.tag }}
image: ${{ secrets.ECR_REGISTRY_SECRET }}/substrate-node:${{ inputs.sha }}
Expand Down Expand Up @@ -144,20 +154,26 @@ jobs:
done

chain-specs:
needs: partner-chains-linux
needs: build-pc-artifacts
uses: ./.github/workflows/modules/chain-specs.yml
permissions:
id-token: write
contents: write
with:
sha: ${{ inputs.sha }}
tag: ${{ inputs.tag }}

deploy-staging-preview:
needs: chain-specs
uses: ./.github/workflows/modules/staging-preview-deploy.yml
permissions:
id-token: write
contents: write
with:
image: ${{ secrets.ECR_REGISTRY_SECRET }}/substrate-node:${{ inputs.sha }}
chain-spec-secret: staging-chain-spec-${{ inputs.sha }}

publish-ghcr-image:
build-and-publish-ghcr-image:
uses: ./.github/workflows/modules/build-and-publish-ghcr-image.yml
with:
commit_sha: ${{ inputs.sha }}
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/modules/chain-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ on:
required: true
type: string
tag:
description: "partner-chains release tag"
description: 'Release Tag'
required: true
type: string

jobs:
chain-specs:
Expand All @@ -18,11 +19,6 @@ jobs:
id-token: write
contents: write
steps:
- name: Set filename variables
id: set-filenames
run: |
echo "PARTNER_CHAINS_NODE_X86_64_LINUX=partner-chains-node-${{ inputs.tag }}-x86_64-linux" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v4
with:
Expand All @@ -46,7 +42,7 @@ jobs:
- name: Download Linux partner-chains-node artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.PARTNER_CHAINS_NODE_X86_64_LINUX }}
name: partner-chains-node-x86_64-linux-artifact-artifact
path: ./

- name: Generate Chain Specs
Expand All @@ -60,7 +56,8 @@ jobs:
- name: Update Kubernetes secret for devnet chain spec
run: |
SHA=${{ inputs.sha }}
SECRET_NAME="devnet-chain-spec-${SHA}"
TAG=${{ inputs.tag }}
SECRET_NAME="devnet-chain-spec-${SHA}-${TAG}"
kubectl delete secret "$SECRET_NAME" --namespace=sc --ignore-not-found
kubectl create secret generic "$SECRET_NAME" \
Expand All @@ -70,7 +67,8 @@ jobs:
- name: Update Kubernetes secret for staging chain spec
run: |
SHA=${{ inputs.sha }}
SECRET_NAME="staging-chain-spec-${SHA}"
TAG=${{ inputs.tag }}
SECRET_NAME="staging-chain-spec-${SHA}-${TAG}"
kubectl delete secret "$SECRET_NAME" --namespace=staging --ignore-not-found
kubectl create secret generic "$SECRET_NAME" \
Expand Down

0 comments on commit 75277ca

Please sign in to comment.