-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (29 loc) · 1.22 KB
/
kubernetes.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
name: deploy to kubernetes
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: login to docker
run: docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Build container image
run: |
docker build . --tag ghcr.io/callieve/metro-map-editor/metro-map-site:${{ github.sha }}
docker image tag ghcr.io/callieve/metro-map-editor/metro-map-site:${{ github.sha }} ghcr.io/callieve/metro-map-editor/metro-map-site:latest
- name: Push image to Docker Hub
run: |
docker push ghcr.io/callieve/metro-map-editor/metro-map-site:${{ github.sha }}
docker push ghcr.io/callieve/metro-map-editor/metro-map-site:latest
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Deploy to DigitalOcean Kubernetes
run: |
doctl kubernetes cluster kubeconfig save k8s-okto
kubectl -n default set image statefulset/metro-map-site metro-map-site=ghcr.io/callieve/metro-map-editor/metro-map-site:${{ github.sha }}