-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.42 KB
/
deploy.yaml
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
name: 🚢 Docker
on:
push:
branches:
- main
pull_request:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docker:
name: 🚢 Docker
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: 🔨 Build image
run: ./docker/build
- name: 🔥 Smoke test
run: ./docker/smoke-test
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: 🚢 Push image
run: ./docker/push
- id: sha
name: Setup Environment
shell: bash
run: |
if [[ -v "GITHUB_SHA" ]]; then
GIT_SHA=${GITHUB_SHA:0:7}
else
GIT_SHA=$(git rev-parse --short=7 HEAD)
fi
echo "GIT_SHA=${GIT_SHA}" >> $GITHUB_OUTPUT
- name: Deploy the app
uses: digitalocean/app_action/deploy@v2
env:
IMAGE_TAG_SEROANALYTICS-SEROVIZR: ${{ steps.sha.outputs.GIT_SHA }}
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
app_name: seroviz
project_id: ${{ secrets.DIGITALOCEAN_PROJECT_ID}}
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'