-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (59 loc) · 2.48 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
name: Build images
on:
push:
branches: [main]
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
# see https://github.com/docker/build-push-action
steps:
# Setup (see https://github.com/docker/build-push-action)
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Store version number (on release)
id: version
if: ${{ github.event_name == 'release' }}
# GITHUB_REF looks like "refs/tags/0.3.1" - we need to extract the actual version without the v prefix
run: echo "number=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
# Build all images
- name: Build and push "base" image
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name == 'release' }}
context: images/base
tags: |
blsq/openhexa-base-environment:${{ steps.version.outputs.number || 'main' }}
blsq/openhexa-base-environment:latest
cache-from: type=registry,ref=blsq/openhexa-base-environment:buildcache
cache-to: type=registry,ref=blsq/openhexa-base-environment:buildcache,mode=max
- name: Build and push "legacy" image
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name == 'release' }}
context: images/legacy
tags: |
blsq/openhexa-legacy-environment:${{ steps.version.outputs.number || 'main' }}
blsq/openhexa-legacy-environment:latest
cache-from: type=registry,ref=blsq/openhexa-legacy-environment:buildcache
cache-to: type=registry,ref=blsq/openhexa-legacy-environment:buildcache,mode=max
- name: Build and push "blsq" image
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name == 'release' }}
context: images/blsq
tags: |
blsq/openhexa-blsq-environment:${{ steps.version.outputs.number || 'main' }}
blsq/openhexa-blsq-environment:latest
cache-from: type=registry,ref=blsq/openhexa-blsq-environment:buildcache
cache-to: type=registry,ref=blsq/openhexa-blsq-environment:buildcache,mode=max