-
Notifications
You must be signed in to change notification settings - Fork 20
90 lines (79 loc) · 2.41 KB
/
container.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
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
90
name: Container
on:
push:
branches:
- main
- develop
- release/*
- ci/*
tags:
- v*
env:
CI: 1
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
concurrency:
group: image-${{ github.ref }}
cancel-in-progress: true
jobs:
image:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Build and publish images
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mode:
- release
outputs:
version: ${{ steps.meta.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- name: Configure sccache
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install docker-buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Login to the GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup container metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=edge
type=raw,enable=${{ github.event_name != 'pull_request' && !contains(github.ref, 'refs/tags/') }},value=build-{{date 'YYYY.MM.DD'}}-{{sha}}
flavor: |
latest=auto
suffix=${{ matrix.mode == 'debug' && '-debug' || ''}}
bake-target: clipcat
- name: Build container image
uses: docker/bake-action@v5
with:
pull: true
push: true
set: |
clipcat.args.SCCACHE_GHA_ENABLED=on
clipcat.args.ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }}
clipcat.args.ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }}
files: |
./dev-support/containers/docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
targets: clipcat