-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (81 loc) · 3.07 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
# Workflow for deploying the DEX explorer webapp https://github.com/penumbra-zone/dex-explorer
# Bounces a container deployment, to repull the latest image.
name: deploy dex-explorer
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-testnet:
name: deploy dex-explorer to testnet
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 testnet rollout restart deployment dex-explorer &&
nix develop --command
kubectl -n testnet rollout status deployment dex-explorer
deploy-mainnet:
name: deploy dex-explorer to mainnet
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 dex-explorer &&
nix develop --command
kubectl -n mainnet rollout status deployment dex-explorer