-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
88 lines (84 loc) · 2.83 KB
/
dockerimages.yml
File metadata and controls
88 lines (84 loc) · 2.83 KB
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
name: Docker Images
on:
pull_request:
paths:
- '.dockerignore'
- '.github/workflows/dockerimages.yml'
- 'Dockerfile.*'
push:
branches:
- main
tags:
- '*'
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}"
cancel-in-progress: true
permissions:
actions: write
jobs:
build:
strategy:
max-parallel: 1
matrix:
component: [ jabkit, jabsrv ]
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
with:
images: |
ghcr.io/JabRef/${{ matrix.component }}
tags: |
type=schedule,pattern={{date 'YYYY-MM-DD'}}
type=ref,event=tag
type=edge,branch=main
type=ref,event=pr
labels: |
org.opencontainers.image.source=https://github.com/JabRef/jabref
org.opencontainers.image.title=${{ matrix.component }}
org.opencontainers.image.description=${{ matrix.component == 'jabkit' && 'JabRef''s CLI tool' || 'JabRef''s HTTP server' }}
- name: Login to GitHub Container Registry
if: >
(github.event_name == 'push' && github.repository == 'JabRef/jabref') ||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'JabRef/jabref')
uses: docker/login-action@v4
with:
registry: ghcr.io
username: koppor
password: ${{ secrets.CR_PAT }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Fetch all history for all tags and branches
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: 'true'
show-progress: 'false'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3.2.1
with:
versionSpec: "5.x"
- name: Run GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v3.2.1
- name: Build and push
uses: docker/build-push-action@v7
with:
push: >
${{
(github.event_name == 'push' && github.repository == 'JabRef/jabref') ||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'JabRef/jabref')
}}
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: Dockerfile.${{ matrix.component }}
build-args: |
VERSION=${{ steps.gitversion.outputs.AssemblySemVer }}
VERSION_INFO=${{ steps.gitversion.outputs.InformationalVersion }}
cache-from: type=gha
cache-to: type=gha,mode=max