-
-
Notifications
You must be signed in to change notification settings - Fork 57
35 lines (31 loc) · 1.05 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
name: Deploy
on:
push:
tags:
- v*
jobs:
build-and-push:
name: Build and Push
runs-on: ubuntu-latest
env:
REGISTRY: registry.digitalocean.com
NAME: ghost/gscan
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Get version
run: echo "IMAGE_VERSION=$(git describe --tags)" >> $GITHUB_ENV
- name: Publish to DigitalOcean Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
registry: ${{ env.REGISTRY }}
name: ${{ env.NAME }}
dockerfile: Dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "latest,${{ env.IMAGE_VERSION }}"
- uses: matootie/dokube@v1.4.0
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: ${{ secrets.CLUSTER_NAME }}
- name: Update deployment
run: kubectl set image deployment/gscan gscan=${{ env.REGISTRY }}/${{ env.NAME }}:${{ env.IMAGE_VERSION }}