Skip to content

Commit

Permalink
ci: add workflow for goerli deployments (#6)
Browse files Browse the repository at this point in the history
* ci: add workflow for goerli deployments

* chore: remove temporary stubs
  • Loading branch information
tenequm authored Dec 21, 2023
1 parent f624a48 commit 695cf13
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/deploy-goerli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Deploy to Goerli

on:
workflow_dispatch:

permissions:
contents: read
id-token: write
deployments: write

jobs:
init:
name: Set global version
runs-on: ubuntu-latest
outputs:
GLOBAL_VERSION: ${{ steps.set_vars.outputs.GLOBAL_VERSION }}
steps:
- name: Set global version
id: set_vars
run: echo "GLOBAL_VERSION=${{ github.sha }}" >> $GITHUB_OUTPUT

build-and-test:
needs: [init]
name: Build
uses: ./.github/workflows/reusable-build-and-test.yml
secrets: inherit
with:
version: ${{ needs.init.outputs.GLOBAL_VERSION }}

deploy-goerli:
needs: [init, build-and-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jkroepke/[email protected]
- name: Setup helmfile
uses: mamezou-tech/[email protected]
with:
install-kubectl: no
install-helm: no
additional-helm-plugins: https://github.com/jkroepke/helm-secrets --version v4.1.1,https://github.com/aslafy-z/helm-git --version 0.14.0
- uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Set up GKE credentials
uses: google-github-actions/[email protected]
with:
cluster_name: mangata-dev-alpha
location: europe-west1

- name: Create a GitHub Deployment
uses: bobheadxi/[email protected]
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: goerli
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}

- run: |
export ENVIRONMENT=goerli
export IMAGE_TAG=${{ needs.init.outputs.GLOBAL_VERSION }}
# https://dev.to/derlin/helmfile-difference-between-sync-and-apply-helm-3-28o1
export HELM_DIFF_THREE_WAY_MERGE=true
helmfile apply -e goerli
working-directory: ops/helmfiles
- name: Update the GitHub Deployment status
uses: bobheadxi/[email protected]
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
env: ${{ steps.deployment.outputs.env }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: "https://eigen-operator-rpc-goerli.mangata.online"

0 comments on commit 695cf13

Please sign in to comment.