-
Notifications
You must be signed in to change notification settings - Fork 13
89 lines (77 loc) · 2.85 KB
/
docker.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
78
79
80
81
82
83
84
85
86
87
88
89
# (c) Copyright 2019-2024 OLX
# This workflow is triggered when semantic-release
# cretes a new tag in the repository.
# A PAT repository secret, SEM_REL_TOKEN, is used to allow
# a new workflow to be triggered, as GITHUB_TOKEN usage does not.
name: post-release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
#permissions:
# checks: write
# Only allow one release workflow to execute at a time, since each release
# workflow uses shared resources (git tags, package registries)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
docker:
runs-on: ubuntu-latest
name: Publish Images
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta for the Dali image with the reqwest feature
id: meta-reqwest
uses: docker/metadata-action@v5
with:
flavor: latest=true
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=master,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
- name: Build and push with the reqwest feature
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
build-args: DALI_FEATURES=reqwest
push: true
tags: ${{ steps.meta-reqwest.outputs.tags }}
labels: ${{ steps.meta-reqwest.outputs.labels }}
- name: Docker meta for the Dali image with the s3 feature
id: meta-s3
uses: docker/metadata-action@v5
with:
flavor: latest=true
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-s3
tags: |
# set latest tag for default branch
type=raw,value=latest,enable=false
type=raw,value=master,enable=false
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
- name: Build and push with the s3 feature
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
build-args: DALI_FEATURES=s3
push: true
tags: ${{ steps.meta-s3.outputs.tags }}
labels: ${{ steps.meta-s3.outputs.labels }}