-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add workflow for goerli deployments (#6)
* ci: add workflow for goerli deployments * chore: remove temporary stubs
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 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
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" |