-
-
Notifications
You must be signed in to change notification settings - Fork 180
86 lines (70 loc) · 2.53 KB
/
docker-publish.yml
File metadata and controls
86 lines (70 loc) · 2.53 KB
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
name: docker-publish
on:
push:
tags:
- v*
jobs:
build:
name: Build and publish '${{ matrix.project }}' to Docker Registry
strategy:
fail-fast: true
matrix:
project: [api, ssh, gateway, ui, ui-react, cli]
runs-on: ubuntu-24.04
steps:
- name: Checkout source code
uses: actions/checkout@v6
- name: Get release version
id: get_version
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and publish '${{ matrix.project }}' to Docker Registry
uses: docker/build-push-action@v7
with:
tags: shellhubio/${{ matrix.project }}:latest,shellhubio/${{ matrix.project }}:${{ env.RELEASE_VERSION }}
push: true
file: ${{ matrix.project }}/Dockerfile
publish-enterprise:
name: Build and publish 'api-enterprise' to Docker Registry
runs-on: ubuntu-24.04
steps:
- name: Checkout shellhub source
uses: actions/checkout@v6
with:
path: shellhub
- name: Generate cloud repo token
id: cloud-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.CLOUD_DISPATCH_APP_ID }}
private-key: ${{ secrets.CLOUD_DISPATCH_APP_PRIVATE_KEY }}
owner: shellhub-io
repositories: cloud
- name: Checkout cloud source
uses: actions/checkout@v6
with:
repository: shellhub-io/cloud
token: ${{ steps.cloud-token.outputs.token }}
ref: ${{ github.ref_name }}
path: cloud
- name: Get release version
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Login to Docker Registry
uses: docker/login-action@v4
with:
registry: registry.infra.ossystems.io
username: ${{ secrets.PORTUS_USERNAME }}
password: ${{ secrets.PORTUS_TOKEN }}
- name: Build and publish 'api-enterprise' to Docker Registry
uses: docker/build-push-action@v7
with:
tags: registry.infra.ossystems.io/shellhub/api-enterprise:latest,registry.infra.ossystems.io/shellhub/api-enterprise:${{ env.RELEASE_VERSION }}
push: true
context: shellhub
file: shellhub/api/Dockerfile
build-args: EDITION=enterprise
build-contexts: cloud-src=./cloud