-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (69 loc) · 2.1 KB
/
build-container.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
name: Build application container
run-name: Generate o-platform ${{ inputs.client_ref }} for api-server ${{ inputs.server_ref }} by @${{ github.actor }}
on:
workflow_call:
inputs:
server_ref:
description: "A ref from CirclesUBI/api-server against which we build."
required: true
type: string
client_ref:
description: "A ref from this repository, CirclesUBI/o-platform."
required: true
type: string
workflow_dispatch:
inputs:
server_ref:
description: "A ref from CirclesUBI/api-server against which we build."
required: true
type: string
client_ref:
description: "A ref from this repository, CirclesUBI/o-platform."
required: true
type: string
env:
REGISTRY: registry.digitalocean.com
IMAGE_OWNER: circles-land
IMAGE_REPOSITORY: o-platform
jobs:
build-container-image:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
-
name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.client_ref }}
-
name: Docker meta outside of branches
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/${{ env. IMAGE_OWNER }}/${{ env.IMAGE_REPOSITORY }}
tags: |
latest-${{ inputs.server_ref }}
{{sha}}-${{ inputs.server_ref }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: |
image=moby/buildkit:v0.10.6
-
name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DIGITALOCEAN_PASSWORD }}
password: ${{ secrets.DIGITALOCEAN_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
build-args: |
SERVER_REF=${{ inputs.server_ref }}
tags: ${{ steps.meta.outputs.tags }}
file: Dockerfile.ci