-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (36 loc) · 1.21 KB
/
ci.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
name: Docker
on:
push:
branches:
- master
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set version tag
id: vars
run: echo "version=$(git log -1 --pretty=%h)" >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: |
mark3labs/louper-web:${{ steps.vars.outputs.version }}
mark3labs/louper-web:latest
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Save DigitalOcean kubeconfig with short-lived credentials
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 662138bb-8236-4da5-8c6d-c602fb6eef82
- name: Deploy to DigitalOcean Kubernetes
run: kubectl rollout restart deployment/louper
- name: Verify deployment
run: kubectl rollout status deployment/louper