-
Notifications
You must be signed in to change notification settings - Fork 9
63 lines (54 loc) · 1.87 KB
/
build_images_uv.yaml
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
name: Docker image CI
on:
pull_request:
branches:
- "**"
# synchronized is when you push new commits
types: ["opened", "synchronize"]
push:
branches:
- main
# required to enable manual triggers on the GH web ui
workflow_dispatch:
jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check for modified paths
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
rebuild:
- '.github/**'
- 'lumigator/**'
- name: Get repo version
if: steps.filter.outputs.rebuild == 'true'
run: |
echo "REPOVERSION=$(git describe --tags --dirty --match \"[0-9\.]*\" --always)" >> $GITHUB_ENV
echo "Version of the repo for this build: $REPOVERSION"
- name: Set up QEMU
if: steps.filter.outputs.rebuild == 'true'
uses: docker/setup-qemu-action@v3
- name: Set up Docker buildx
if: steps.filter.outputs.rebuild == 'true'
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: steps.filter.outputs.rebuild == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
if: steps.filter.outputs.rebuild == 'true'
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
target: "main_image"
tags: |
mzdotai/lumigator:backend_dev_${{ env.REPOVERSION }}
${{ github.ref == 'refs/heads/main' && 'mzdotai/lumigator:latest' || '' }}