-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
22 changed files
with
1,266 additions
and
19 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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,25 @@ | ||
--- | ||
name: ▶️ Deploy Master | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
uses: ./.github/workflows/tpl-images.yml | ||
secrets: inherit | ||
deploy: | ||
name: Deploy | ||
needs: | ||
- build | ||
uses: ./.github/workflows/tpl-deploy-app.yml | ||
with: | ||
env-type: test-master | ||
chain-id: 11155111 | ||
network-name: sepolia | ||
chain-name: sepolia | ||
snapshotter-enabled: true | ||
scheduler-enabled: true | ||
vault-confirm-withdrawals-enabled: true | ||
glm-claim-enabled: true | ||
secrets: inherit |
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,104 @@ | ||
--- | ||
name: ♻ PR Deployment | ||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
needs: | ||
- run | ||
uses: ./.github/workflows/tpl-images.yml | ||
secrets: inherit | ||
with: | ||
image-tag: ${{ needs.run.outputs.sha }} | ||
|
||
deploy: | ||
name: Deploy | ||
needs: | ||
- run | ||
- build | ||
uses: ./.github/workflows/tpl-deploy-app.yml | ||
with: | ||
# --- | ||
env-type: pr | ||
image-tag: ${{ needs.run.outputs.sha }} | ||
pull-request-id: ${{ needs.run.outputs.pr_id }} | ||
workflow-id: ${{ github.run_id }} | ||
env-id: ${{ needs.run.outputs.env }} | ||
deployment-id: ${{ needs.run.outputs.deployment }} | ||
# --- | ||
deploy-contracts: true | ||
chain-id: 1337 | ||
network-name: local | ||
chain-name: localhost | ||
snapshotter-enabled: true | ||
scheduler-enabled: true | ||
vault-confirm-withdrawals-enabled: true | ||
glm-claim-enabled: true | ||
secrets: inherit | ||
|
||
run: | ||
name: Run | ||
if: github.event.issue.pull_request && contains(github.event.comment.body, '/deploy') | ||
runs-on: | ||
- metal | ||
outputs: | ||
sha: ${{ steps.comment-branch.outputs.head_sha }} | ||
ref: ${{ steps.comment-branch.outputs.head_ref }} | ||
pr_id: ${{ steps.get-pr-number.outputs.result }} | ||
env: ${{ steps.start-deployment.outputs.env }} | ||
deployment: ${{ steps.start-deployment.outputs.deployment_id }} | ||
steps: | ||
- name: Get PR branch | ||
uses: xt0rted/pull-request-comment-branch@v2 | ||
id: comment-branch | ||
|
||
- uses: actions/github-script@v7 | ||
id: get-pr-number | ||
with: | ||
result-encoding: string | ||
script: | | ||
return ( | ||
await github.rest.repos.listPullRequestsAssociatedWithCommit({ | ||
commit_sha: '${{ steps.comment-branch.outputs.head_sha }}', | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}) | ||
).data[0].number; | ||
- uses: actions/[email protected] | ||
with: | ||
path: __local | ||
ref: ${{ steps.comment-branch.outputs.head_ref }} | ||
|
||
- name: Get environment name | ||
id: env-name | ||
env: | ||
CI_MERGE_REQUEST_IID: ${{ steps.get-pr-number.outputs.result }} | ||
CI_PIPELINE_ID: ${{ github.run_id }} | ||
run: | | ||
set -ex | ||
export CI_PROJECT_DIR="${GITHUB_WORKSPACE}/__local" | ||
source ${CI_PROJECT_DIR}/ci/argocd/resolve_env.sh $ENV_TYPE | ||
echo "DEPLOYMENT_ID=$DEPLOYMENT_ID" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: (debug) | ||
run: | | ||
echo ${{ steps.get-pr-number.outputs.result }} | ||
echo ${{ steps.env-name.outputs.DEPLOYMENT_ID }} | ||
echo ${{ github.run_id }} | ||
- name: start deployment | ||
uses: bobheadxi/deployments@v1 | ||
id: start-deployment | ||
with: | ||
step: start | ||
token: ${{ secrets.GH_BOT_TOKEN }} | ||
env: ${{ steps.env-name.outputs.DEPLOYMENT_ID }} | ||
ref: ${{ steps.comment-branch.outputs.head_ref }} | ||
override: true |
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,54 @@ | ||
--- | ||
name: ▶️ Deploy Release Candidate | ||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
ARGO_REPOSITORY: "https://wildland-bot:${{ secrets.HOUSEKEEPER_CI_TOKEN }}@gitlab.com/golemfoundation/devops/iac/k8s/wildland-k8s-devops.git" | ||
ARGO_REPOSITORY_BRANCH: "github/release-candidate" | ||
IMAGE_TAG: "${{ github.sha }}" | ||
HOUSEKEEPER_GPG_KEY: "${{ secrets.HOUSEKEEPER_GPG_KEY }}" | ||
HOUSEKEEPER_GPG_KEY_ID: "${{ secrets.HOUSEKEEPER_GPG_KEY_ID }}" | ||
HOUSEKEEPER_NAME: "${{ vars.HOUSEKEEPER_NAME }}" | ||
HOUSEKEEPER_EMAIL: "${{ secrets.HOUSEKEEPER_EMAIL }}" | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
uses: ./.github/workflows/tpl-images.yml | ||
secrets: inherit | ||
with: | ||
image-tag: ${{ github.sha }} | ||
deploy: | ||
name: Deploy | ||
needs: | ||
- build | ||
runs-on: | ||
- metal | ||
container: | ||
image: registry.gitlab.com/golemfoundation/devops/container-builder/gitops-builder:2ea6d57c | ||
credentials: | ||
username: "doesnt-matter" | ||
password: "${{ secrets.GITLAB_PAT_CONTAINER_BUILDER_DOCKER_IMAGES_READ }}" | ||
steps: | ||
- uses: actions/[email protected] | ||
- run : | | ||
set -ex | ||
gpg --import <(echo $HOUSEKEEPER_GPG_KEY | base64 -d) | ||
git config --global user.name "$HOUSEKEEPER_NAME" | ||
git config --global user.email "$HOUSEKEEPER_EMAIL" | ||
git config --global user.signingkey $HOUSEKEEPER_GPG_KEY_ID | ||
GIT_DIR=`mktemp -d` | ||
git clone -b $ARGO_REPOSITORY_BRANCH $ARGO_REPOSITORY $GIT_DIR | ||
pushd $GIT_DIR | ||
yq -y -i -e ".[].value.value = \"$IMAGE_TAG\"" mainnet/octant-image.values.yaml | ||
git add mainnet/octant-image.values.yaml | ||
git commit -S -m "Changed octant image tag to $IMAGE_TAG at $(date +%Y-%m-%d)" || true | ||
git push | ||
shell: bash |
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,41 @@ | ||
--- | ||
name: ▶️ Deploy UAT | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
uses: ./.github/workflows/tpl-images.yml | ||
secrets: inherit | ||
with: | ||
image-tag: ${{ github.sha }} | ||
run: | ||
name: Run | ||
uses: ./.github/workflows/tpl-start-env.yml | ||
secrets: inherit | ||
with: | ||
git-ref: ${{ github.ref }} | ||
env-type: test-uat | ||
workflow-id: ${{ github.run_id }} | ||
deploy: | ||
name: Deploy | ||
needs: | ||
- build | ||
- run | ||
uses: ./.github/workflows/tpl-deploy-app.yml | ||
with: | ||
env-type: test-uat | ||
env-id: ${{ needs.run.outputs.env-id }} | ||
deployment-id: ${{ needs.run.outputs.deployment-id }} | ||
image-tag: ${{ github.sha }} | ||
workflow-id: ${{ github.run_id }} | ||
# --- | ||
chain-id: 11155111 | ||
network-name: sepolia | ||
chain-name: sepolia | ||
snapshotter-enabled: true | ||
scheduler-enabled: true | ||
vault-confirm-withdrawals-enabled: true | ||
glm-claim-enabled: true | ||
secrets: inherit |
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,12 @@ | ||
--- | ||
name: 🔻 Stop Master | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
name: Run | ||
uses: ./.github/workflows/tpl-destroy-env.yml | ||
secrets: inherit | ||
with: | ||
env-type: test-master |
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,12 @@ | ||
--- | ||
name: 🔻 Stop UAT | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
name: Run | ||
uses: ./.github/workflows/tpl-destroy-env.yml | ||
secrets: inherit | ||
with: | ||
env-type: test-uat |
Oops, something went wrong.