This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
97 lines (82 loc) · 2.3 KB
/
release.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
push:
tags:
- v*
jobs:
check:
uses: ./.github/workflows/check.yml
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: cp .env.example .env
- run: npm test
push:
runs-on: ubuntu-latest
needs: [check, test]
outputs:
version: ${{ steps.app_meta.outputs.version }}
steps:
- uses: actions/checkout@v3
- id: app_meta
uses: docker/metadata-action@v4
with:
flavor: |
latest=false
images: |
${{ secrets.DOCKER_ORGANISATION }}/beabee
tags: |
type=ref,event=tag
release
- id: router_meta
uses: docker/metadata-action@v4
with:
flavor: |
latest=false
images: |
${{ secrets.DOCKER_ORGANISATION }}/router
tags: |
type=ref,event=tag
release
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/build-push-action@v4
with:
context: .
target: app
push: true
tags: ${{ steps.app_meta.outputs.tags }}
labels: ${{ steps.app_meta.outputs.labels }}
build-args: |
REVISION=${{ github.sha }}
- uses: docker/build-push-action@v4
with:
context: .
target: router
push: true
tags: ${{ steps.router_meta.outputs.tags }}
labels: ${{ steps.router_meta.outputs.labels }}
build-args: |
REVISION=${{ github.sha }}
release:
runs-on: ubuntu-latest
needs: [push]
steps:
- uses: actions/checkout@v3
with:
repository: beabee-communityrm/hive-deploy-stack
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- run: |
git config --global user.name "Deploy bot"
git config --global user.email "<>"
echo -n ${{ needs.push.outputs.version }} > API_VERSION
./update.sh
git add API_VERSION docker-compose.yml
if ! git diff --quiet --cached; then
git commit -m "Deploy API ${{ needs.push.outputs.version }}"
git push
fi