-
Notifications
You must be signed in to change notification settings - Fork 26
43 lines (40 loc) · 1.53 KB
/
main.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
name: Docker Image CI
on:
workflow_dispatch:
push:
branches: ["*"]
pull_request:
branches: ["main"]
env:
VERSION: "1.6"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Extract tag
shell: bash
run: echo "tag=`echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | awk '{ if ($0 == "main") {print "latest"} else {print $0;} }'`" >> $GITHUB_OUTPUT
id: extract_tag
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ProductiveOps Docker Hub Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERREGISTRY_USERNAME }}
password: ${{ secrets.DOCKERREGISTRY_PASSWORD }}
- name: Build and Push Server
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}"
file: Dockerfile.server
push: true
platforms: linux/amd64,linux/arm64
tags: productiveops/dokemon:${{ steps.extract_tag.outputs.tag }}${{ steps.extract_tag.outputs.tag == 'latest' && format(' , productiveops/dokemon:{0}', env.VERSION) || '' }}
- name: Build and Push Agent
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}"
file: Dockerfile.agent
push: true
platforms: linux/amd64,linux/arm64
tags: productiveops/dokemon-agent:${{ steps.extract_tag.outputs.tag }}${{ steps.extract_tag.outputs.tag == 'latest' && format(' , productiveops/dokemon-agent:{0}', env.VERSION) || '' }}