generated from MOZGIII/template-rust
-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (82 loc) · 2.57 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
90
91
name: docker
on:
push:
branches:
- "**"
- "!gh-readonly-queue/**"
tags:
- "v*.*.*"
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.event_name != 'merge_group' }}
jobs:
docker:
name: Docker
runs-on: ubuntu-22.04
timeout-minutes: 50
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
timeout-minutes: 5
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta for sap
id: meta-sap
uses: docker/metadata-action@v5
with:
bake-target: docker-metadata-action-sap
images: |
ghcr.io/${{ github.repository }}
labels: |
org.opencontainers.image.title=${{ github.repository }}-sap
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Docker meta for sap-onbuild
id: meta-sap-onbuild
uses: docker/metadata-action@v5
with:
bake-target: docker-metadata-action-sap-onbuild
images: |
ghcr.io/${{ github.repository }}
labels: |
org.opencontainers.image.title=${{ github.repository }}-sap-onbuild
flavor: |
suffix=-onbuild,onlatest=true
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/bake-action@master
with:
files: |
./docker-bake.hcl
${{ steps.meta-sap.outputs.bake-file }}
${{ steps.meta-sap-onbuild.outputs.bake-file }}
push: ${{ github.event_name != 'pull_request' }}
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max