forked from paritytech/polkadot-testnet-faucet
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc5bc59
commit e029e1b
Showing
45 changed files
with
5,575 additions
and
2,974 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
name: Deploy to Testnet | ||
|
||
on: | ||
workflow_dispatch: | ||
# TESTING, remove before merge | ||
push: | ||
branches: | ||
- A0-3755 | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
deploy-faucet: | ||
name: Build and push faucet image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: GIT | 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@v6 | ||
|
||
- name: Get facuet rc image name | ||
id: get-image-name | ||
env: | ||
ECR_REGISTRY: '${{ vars.ECR_PUBLIC_REGISTRY }}' | ||
APP: faucet | ||
TAG: '${{ steps.get-ref-properties.outputs.sha }}' | ||
shell: bash | ||
run: | | ||
image=${{ env.ECR_REGISTRY }}/${{ env.APP }}:${{ env.TAG }} | ||
echo "image=${image}" >> $GITHUB_OUTPUT | ||
- name: Check deploy image existence | ||
uses: Cardinal-Cryptography/github-actions/check-image-existence-ecr@v6 | ||
with: | ||
ecr-image: ${{ steps.get-image-name.outputs.image }} | ||
|
||
- name: Get repo owner | ||
id: get-repo-owner | ||
shell: bash | ||
run: | | ||
echo "repo-owner=$GITHUB_REPOSITORY_OWNER" >> $GITHUB_OUTPUT | ||
- name: GIT | Checkout argocd apps repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: 'testnet' | ||
# yamllint disable-line rule:line-length | ||
repository: ${{ steps.get-repo-owner.outputs.repo-owner }}/${{ secrets.REPO_ARGOCD_APPS_NAME }} | ||
token: ${{ secrets.CI_GH_TOKEN }} | ||
path: ${{ secrets.REPO_ARGOCD_APPS_NAME }} | ||
|
||
- name: Init kustomize | ||
uses: imranismail/setup-kustomize@v2 | ||
with: | ||
kustomize-version: ${{ vars.KUSTOMIZE_VERSION }} | ||
|
||
- name: Update faucet Testnet image in kustomize file | ||
env: | ||
RELEASE_IMAGE: ${{ steps.get-image-name.outputs.image }} | ||
REGIONS_AWS: 'eu-central-1' | ||
run: | | ||
export aleph_path=$(pwd) | ||
export apps_name=${{ secrets.REPO_ARGOCD_APPS_NAME }} | ||
cd ${aleph_path}/${apps_name}/faucet/overlays/testnet/${{ env.REGIONS_AWS }} | ||
kustomize edit set image "faucet-image-placeholder=${{ env.RELEASE_IMAGE }}" | ||
- name: GIT | Commit changes to argocd apps repository. | ||
uses: EndBug/[email protected] | ||
with: | ||
author_name: ${{ secrets.AUTOCOMMIT_AUTHOR }} | ||
author_email: ${{ secrets.AUTOCOMMIT_EMAIL }} | ||
# yamllint disable-line rule:line-length | ||
message: "Updating testnet faucet docker image tag to: ${{ steps.get-image-name.outputs.image }}" | ||
add: "*.yaml" | ||
cwd: ${{ secrets.REPO_ARGOCD_APPS_NAME }} | ||
branch: testnet | ||
# TESTING, remove below line | ||
push: false |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
name: Push to main commit | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# TESTING, remove before merge | ||
- A0-3755 | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
main: | ||
name: Build and push faucet image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: GIT | 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@v6 | ||
|
||
- name: Get facuet rc image name | ||
id: get-image-name | ||
env: | ||
ECR_REGISTRY: '${{ vars.ECR_PUBLIC_REGISTRY }}' | ||
APP: faucet | ||
TAG: '${{ steps.get-ref-properties.outputs.sha }}' | ||
shell: bash | ||
run: | | ||
image=${{ env.ECR_REGISTRY }}/${{ env.APP }}:${{ env.TAG }} | ||
echo "image=${image}" >> $GITHUB_OUTPUT | ||
- name: Build docker image with PR aleph-node binary | ||
run: | | ||
docker build \ | ||
--tag '${{ steps.get-image-name.outputs.image }}' \ | ||
-f ./docker/Dockerfile . | ||
- name: Login to ECR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ vars.ECR_PUBLIC_HOST }} | ||
username: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }} | ||
password: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }} | ||
|
||
- name: Push image to the ECR registry | ||
id: push-image | ||
run: | | ||
docker push '${{ steps.get-image-name.outputs.image }}' | ||
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
name: PR commit | ||
on: | ||
pull_request: | ||
merge_group: | ||
# TESTING, remove before merge | ||
push: | ||
branches: | ||
- A0-3755 | ||
|
||
jobs: | ||
pr: | ||
continue-on-error: true | ||
strategy: | ||
matrix: | ||
step: ['lint', 'build'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: ${{ matrix.step }} | ||
run: | | ||
yarn install --immutable | ||
yarn ${{ matrix.step }} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
name: GH Action YAML linter | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
paths: | ||
- '.github/**.yml' | ||
- '.github/**.yaml' | ||
# TESTING, remove before merge | ||
push: | ||
branches: | ||
- A0-3755 | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
main: | ||
name: YAML Lint | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: LINT | Execute YAML linter | ||
uses: Cardinal-Cryptography/github-actions/yaml-lint@v6 |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
name: GH Action YAML validator | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
paths: | ||
- '.github/**.yml' | ||
- '.github/**.yaml' | ||
# TESTING, remove before merge | ||
push: | ||
branches: | ||
- A0-3755 | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
main: | ||
name: YAML Validate | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: VALIDATE | Execute github-actions-validator | ||
uses: Cardinal-Cryptography/github-actions/yaml-validate@v6 |
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,5 +7,3 @@ public | |
.DS_Store | ||
.idea | ||
.env.template | ||
reset_backend.sh | ||
restart_frontend.sh |
Oops, something went wrong.