-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from penumbra-zone/5-auto-deploys
ci: add auto-deploy workflow
- Loading branch information
Showing
2 changed files
with
66 additions
and
7 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 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,56 @@ | ||
--- | ||
# Workflow for deploying the Insights dashboard webapp https://github.com/penumbra-zone/penumbers | ||
# Bounces a container deployment, to repull the latest image. | ||
name: deploy insights | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-container: | ||
name: build container | ||
uses: ./.github/workflows/container.yml | ||
secrets: inherit | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
deploy: | ||
name: deploy insights | ||
env: | ||
DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | ||
needs: | ||
- build-container | ||
runs-on: buildjet-8vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: install nix | ||
uses: nixbuild/nix-quick-install-action@v28 | ||
|
||
- name: setup nix cache | ||
uses: nix-community/cache-nix-action@v5 | ||
with: | ||
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }} | ||
restore-prefixes-first-match: nix-${{ runner.os }}- | ||
backend: buildjet | ||
|
||
# Confirm that the nix devshell is buildable and runs at all. | ||
- name: validate nix env | ||
run: nix develop --command echo hello | ||
|
||
- name: save DigitalOcean kubeconfig with short-lived credentials | ||
run: > | ||
nix develop --command | ||
doctl kubernetes cluster kubeconfig save --expiry-seconds 600 plinfra | ||
# We assume that dex-explorer has been deployed to the cluster already. | ||
# This task merely "bounces" the service, so that a fresh container is pulled. | ||
- name: deploy dex-explorer | ||
run: > | ||
nix develop --command | ||
kubectl -n mainnet rollout restart deployment insights && | ||
nix develop --command | ||
kubectl -n mainnet rollout status deployment insights |