Skip to content

Commit

Permalink
Merge branch 'master' into fix/oct-1370-patron-earnings-wrong-values
Browse files Browse the repository at this point in the history
  • Loading branch information
aziolek committed Feb 22, 2024
2 parents e1d28e7 + 7660283 commit b420327
Show file tree
Hide file tree
Showing 23 changed files with 1,356 additions and 830 deletions.
471 changes: 471 additions & 0 deletions .github/workflows/ci-run.yml

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions .github/workflows/deploy-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: ▶️ Deploy Master
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: master
workflow-id: ${{ github.run_id }}
deploy:
name: Deploy
needs:
- build
- run
uses: ./.github/workflows/tpl-deploy-app.yml
with:
env-type: master
branch-head-ref: ${{ github.ref }}
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
105 changes: 105 additions & 0 deletions .github/workflows/deploy-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
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
branch-head-ref: ${{ needs.run.outputs.ref }}
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
35 changes: 35 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: ▶️ Deploy Production
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

env:
IMAGE_TAG: "${{ github.sha }}"
GIT_TAG: "${{ github.ref }}"

jobs:
build:
name: Build
uses: ./.github/workflows/tpl-images.yml
secrets: inherit
with:
image-tag: ${{ github.sha }}
output:
name: Output Variables
needs:
- build
runs-on:
- metal
steps:
- name: Show variables for the CI pipeline
run : |
echo '================================'
echo ' Use the following variables'
echo ''
echo "CI_PIPELINE_SOURCE: pipeline"
echo "DEV_IMAGE_TAG: ${{ github.sha }}"
echo "PROD_IMAGE_TAG: ${GIT_TAG##*/}"
shell: bash

54 changes: 54 additions & 0 deletions .github/workflows/deploy-rc.yml
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/octant-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
42 changes: 42 additions & 0 deletions .github/workflows/deploy-uat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
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: uat
workflow-id: ${{ github.run_id }}
deploy:
name: Deploy
needs:
- build
- run
uses: ./.github/workflows/tpl-deploy-app.yml
with:
env-type: uat
branch-head-ref: ${{ github.ref }}
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
12 changes: 12 additions & 0 deletions .github/workflows/destroy-master.yml
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: master
12 changes: 12 additions & 0 deletions .github/workflows/destroy-uat.yml
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: uat
Loading

0 comments on commit b420327

Please sign in to comment.