-
Notifications
You must be signed in to change notification settings - Fork 16
94 lines (90 loc) · 3.13 KB
/
build-image.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
name: build-image
on: [push, workflow_dispatch]
jobs:
build-api:
runs-on: ubuntu-22.04
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2.1.0
with:
registry: docker.io
username: sssomeshhh
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Setup Docker Buildx
id: setup_buildx
uses: docker/setup-buildx-action@v2.2.1
- name: Build Load 'api'
id: docker_load_api
uses: docker/build-push-action@v3.2.0
with:
builder: ${{ steps.setup_buildx.outputs.name }}
target: api
cache-from: |
type=registry,ref=sssomeshhh/cache:tgmb-api-master
type=registry,ref=sssomeshhh/cache:tgmb-api-${{ github.ref_name }}
cache-to: |
type=registry,ref=sssomeshhh/cache:tgmb-api-${{ github.ref_name }}
load: false
push: false
build-sdk:
runs-on: ubuntu-22.04
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2.1.0
with:
registry: docker.io
username: sssomeshhh
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Setup Docker Buildx
id: setup_buildx
uses: docker/setup-buildx-action@v2.2.1
- name: Build Load 'sdk'
id: docker_load_sdk
uses: docker/build-push-action@v3.2.0
with:
builder: ${{ steps.setup_buildx.outputs.name }}
target: sdk
cache-from: |
type=registry,ref=sssomeshhh/cache:tgmb-sdk-master
type=registry,ref=sssomeshhh/cache:tgmb-sdk-${{ github.ref_name }}
cache-to: |
type=registry,ref=sssomeshhh/cache:tgmb-sdk-${{ github.ref_name }}
load: false
push: false
build-app:
runs-on: ubuntu-22.04
needs: [build-api, build-sdk]
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ksssomesh12
password: ${{ secrets.GH_PACKAGES_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2.1.0
with:
registry: docker.io
username: sssomeshhh
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Setup Docker Buildx
id: setup_buildx
uses: docker/setup-buildx-action@v2.2.1
- name: Build Push 'app'
id: docker_push_app
uses: docker/build-push-action@v3.2.0
with:
builder: ${{ steps.setup_buildx.name }}
target: app
cache-from: |
type=registry,ref=sssomeshhh/cache:tgmb-api-${{ github.ref_name }}
type=registry,ref=sssomeshhh/cache:tgmb-sdk-${{ github.ref_name }}
type=registry,ref=sssomeshhh/cache:tgmb-app-master
type=registry,ref=sssomeshhh/cache:tgmb-app-${{ github.ref_name }}
cache-to: |
type=registry,ref=sssomeshhh/cache:tgmb-app-${{ github.ref_name }}
load: false
push: true
tags: |
ghcr.io/ksssomesh12/tgmb-beta:${{ github.sha }}
ghcr.io/ksssomesh12/tgmb-beta:${{ github.ref_name }}