-
Notifications
You must be signed in to change notification settings - Fork 37
35 lines (33 loc) · 1.69 KB
/
node-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
name: Node deployment
on:
push:
branches:
- main
jobs:
build-push-docker-image:
name: Build and push passive node Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker log in
run: docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} docker.pkg.github.com
- name: Build Docker image
run: docker build -f ./programs/p2p-loader/Dockerfile -t docker.pkg.github.com/${{ github.repository }}/passive-node:$(echo $GITHUB_SHA | head -c7) .
- name: Push Docker image
run: |
docker push docker.pkg.github.com/${{ github.repository }}/passive-node:$(echo $GITHUB_SHA | head -c7)
docker tag docker.pkg.github.com/${{ github.repository }}/passive-node:$(echo $GITHUB_SHA | head -c7) docker.pkg.github.com/${{ github.repository }}/passive-node:latest
docker push docker.pkg.github.com/${{ github.repository }}/passive-node:latest
- name: Update deployment config
run: TAG=$(echo $GITHUB_SHA | head -c7) && sed -i 's|<TAG>|'${TAG}'|' .maintain/node-deploy-kube-config.yml
- name: Save DigitalOcean kubeconfig
uses: digitalocean/action-doctl@master
env:
DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
with:
args: kubernetes cluster kubeconfig show ${{ secrets.DIGITALOCEAN_KUBERNETES_CLUSTER_NAME }} > .kubeconfig
- name: Deploy to DigitalOcean Kubernetes
# TODO: use `--prune` for the namespace?
run: kubectl --kubeconfig=.kubeconfig apply -f .maintain/node-deploy-kube-config.yml
- name: Verify deployment
run: kubectl --kubeconfig=.kubeconfig rollout status --namespace=redshirt-bootnodes statefulsets/passive-node