-
Notifications
You must be signed in to change notification settings - Fork 201
68 lines (57 loc) · 2.57 KB
/
docker-pull.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
---
name: docker pull_request
# Runs on a pull request to trunk as well as updates to the pull request
on:
pull_request:
branches:
- trunk
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
########################
# CI Setup #
########################
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: "2"
# For PRs, this action compares between the commit and trunk
- name: Get specific changed files
id: changed-files-specific
uses: tj-actions/changed-files@v32
with:
files: |
Dockerfile
########################
# Build Base #
########################
- name: Build docker base image (pull_request with base changes)
if: ${{ steps.changed-files-specific.outputs.any_changed == 'true' }}
run: docker build --target base -t opencbdc-tx-base-local .
########################
# Submodules #
########################
- name: Pull submodules
run: git submodule init && git submodule update
########################
# Build Application #
########################
- name: Build twophase docker image (pull_request with base changes)
if: ${{ steps.changed-files-specific.outputs.any_changed == 'true' }}
run: docker build --target twophase --build-arg BASE_IMAGE=opencbdc-tx-base-local .
- name: Build atomizer docker image (pull_request with base changes)
if: ${{ steps.changed-files-specific.outputs.any_changed == 'true' }}
run: docker build --target atomizer --build-arg BASE_IMAGE=opencbdc-tx-base-local .
- name: Build parsec docker image (pull_request with base changes)
if: ${{ steps.changed-files-specific.outputs.any_changed == 'true' }}
run: docker build --target parsec --build-arg BASE_IMAGE=opencbdc-tx-base-local .
- name: Build twophase docker image (pull_request with no base changes)
if: ${{ steps.changed-files-specific.outputs.any_changed == 'false' }}
run: DOCKER_BUILDKIT=1 docker build --target twophase .
- name: Build atomizer docker image (pull_request with no base changes)
if: ${{ steps.changed-files-specific.outputs.any_changed == 'false' }}
run: DOCKER_BUILDKIT=1 docker build --target atomizer .
- name: Build parsec docker image (pull_request with no base changes)
if: ${{ steps.changed-files-specific.outputs.any_changed == 'false' }}
run: DOCKER_BUILDKIT=1 docker build --target parsec .