-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A0-0000: Make Deploy to Testnet and Mainnet workflows run from inputs…
… tag (#1947) It turns out it is more convient to run Deploy to Testnet and Mainnet workflows from input tag, as those workflows can fail while tagged already, like this one https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/13284043237/job/37088626598, and there's no way to re-tag and fix the issue in the workflow. Instead, those should be always called from `main` - if there's an issue in them, we can fix them and run them again against the same tag. This PR requires some GitHub Actions shenanigans knowledge: * There's a mess in GHA with regards to checkout out dirs of the same repo, see actions/runner#2816. Theefore, we need to call so called composite acionts via full path, ie `Cardinal-Cryptography/aleph-node/.github/actions/get-docker-image-names@main` * our action `get-ref-properties` it's a little bit mess too, as first of all it assumes there's some aleph-node cloned beforehand, and secondly parts of its logic requires this cloned repo, and part based on what ref was checked out by GitHub. Therefore, I removed it's usage in one place. This action should be reworked eventually, but it's out of scope of this PR. * there's one `fetch-depth: '0'` usage, and it's required because by default checkout actions downloads only current ref Testing: run Deploy to Testnet and Mainnet run with modified version which does not any write/push. * https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/13325962070/job/37219219310 * https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/13325942309 Unfortunately, I cannot test on push tag workflow that this PR modifies. Please read carefully dear reviewer, and we'll battle-test this single workflow in the future.
- Loading branch information
1 parent
8b845ea
commit 74c888e
Showing
5 changed files
with
39 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,10 @@ on: | |
required: true | ||
type: string | ||
description: mainnet or testnet | ||
tag: | ||
description: aleph-node git tag to deploy | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
main: | ||
|
@@ -22,20 +26,18 @@ jobs: | |
echo 'Error: inputs.env should be either mainnet or testnet!' | ||
exit 1 | ||
fi | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Call action get-ref-properties | ||
id: get-ref-properties | ||
uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7 | ||
if [[ '${{ inputs.tag }}' == '' ]]; then | ||
echo 'Error: inputs.tag should be set!' | ||
exit 2 | ||
fi | ||
- name: Call action Get ECR image names | ||
id: get-docker-image-names | ||
uses: ./.github/actions/get-docker-image-names | ||
uses: Cardinal-Cryptography/aleph-node/.github/actions/get-docker-image-names@main | ||
with: | ||
ecr-repo: ${{ vars.ECR_ALEPH_NODE_REPO }} | ||
dockerhub-repo: ${{ vars.DOCKERHUB_ALEPH_NODE_REPO }} | ||
tag: ${{ inputs.tag }} | ||
|
||
# this step checks indirectly as well that git HEAD has an r-* tag | ||
# otherwise ECR image would not exist | ||
|
@@ -67,7 +69,7 @@ jobs: | |
- name: Update aleph-node docker image and trigger ArgoCD deploy for ${{ inputs.env }} | ||
env: | ||
DEPLOY_IMAGE: ${{ steps.get-docker-image-names.outputs.ecr-deploy-image }} | ||
REGIONS_AWS: 'eu-central-1,eu-west-1,eu-west-2,us-east-1,us-east-2' | ||
REGIONS_AWS: 'eu-central-1,us-east-1' | ||
shell: bash | ||
run: | | ||
IFS="," read -a region_array <<< ${{ env.REGIONS_AWS }} | ||
|
@@ -96,7 +98,7 @@ jobs: | |
- name: GIT | Commit changes to argocd apps repository. | ||
uses: EndBug/[email protected] | ||
env: | ||
TAG: ${{ steps.get-ref-properties.outputs.tag }} | ||
TAG: ${{ inputs.tag }} | ||
with: | ||
author_name: ${{ secrets.AUTOCOMMIT_AUTHOR }} | ||
author_email: ${{ secrets.AUTOCOMMIT_EMAIL }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters