-
-
Notifications
You must be signed in to change notification settings - Fork 102
84 lines (69 loc) · 2.38 KB
/
build.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
name: karrio-build
on:
push:
branches: ["main"]
jobs:
changes:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.changes.outputs.version }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
version:
- 'apps/api/karrio/server/VERSION'
server-build:
needs: changes
if: ${{ needs.changes.outputs.version == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v3
- id: get_tag
run: |
cat ./apps/api/karrio/server/VERSION
echo "tag=$(cat ./apps/api/karrio/server/VERSION)" >> "$GITHUB_ENV"
- name: Build karrio server image
run: |
echo 'Building karrio server:${{ env.tag }}...'
./bin/build-server-image-from-source ${{ env.tag }}
- name: Push karrio server image
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
echo 'Pushing karrio server:${{ env.tag }}...'
docker push karrio/server:${{ env.tag }}
docker tag karrio/server:${{ env.tag }} karrio/server:latest-rc
docker push karrio/server:latest-rc
dashboard-build:
needs: changes
if: ${{ needs.changes.outputs.version == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v3
- id: get_tag
run: |
cat ./apps/api/karrio/server/VERSION
echo "tag=$(cat ./apps/api/karrio/server/VERSION)" >> "$GITHUB_ENV"
- name: Build karrio dashboard image
run: |
echo 'Building karrio dashboard:${{ env.tag }}...'
export NEXT_PUBLIC_DASHBOARD_VERSION=${{ env.tag }}
export NEXT_PUBLIC_KARRIO_VERSION="http://locahost:5002"
./bin/build-dashboard-image ${{ env.tag }}
- name: Push karrio dashboard image
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
echo 'Pushing karrio dashboard:${{ env.tag }}...'
docker push karrio/dashboard:${{ env.tag }}
docker tag karrio/dashboard:${{ env.tag }} karrio/dashboard:latest-rc
docker push karrio/dashboard:latest-rc