forked from jitsi/docker-jitsi-meet
-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (66 loc) · 2.26 KB
/
docker-publish-individual.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
name: Docker Publish Jitsi Component
on:
workflow_call:
inputs:
folder:
required: true
type: string
repository:
required: false
type: string
default: ""
ref:
required: false
type: string
default: ""
secrets:
github-token:
required: true
env:
REGISTRY: ghcr.io
REGISTRY_BASE_PATH: ghcr.io/${{ github.repository }}
BASE_TAG: ${{ github.ref_name }}
jobs:
build-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout other repository
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}
path: ${{ inputs.folder }}
if: ${{ inputs.repository != '' }}
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.github-token }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_BASE_PATH }}/${{ inputs.folder }}
# Turn off auto-latest, as we want to exclude openshift tags from that
flavor: |
latest=false
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: "${{ inputs.folder }}"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ format('{0}{1}{2}', steps.meta.outputs.tags, env.MAINLINE_TAG, env.OPENSHIFT_TAG) }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"BASE_TAG=${{ contains(github.ref_name, '/merge') && github.base_ref || env.BASE_TAG }}"
"JITSI_REPO=${{ env.REGISTRY_BASE_PATH }}"
env:
# Construct additional Docker tags if this is specific Git tags
MAINLINE_TAG: ${{ startsWith(github.ref, 'refs/tags/stable-') && format(',{0}/{1}:{2}', env.REGISTRY_BASE_PATH, inputs.folder, 'latest') || '' }}
OPENSHIFT_TAG: ${{ startsWith(github.ref, 'refs/tags/openshift-') && format(',{0}/{1}:{2}', env.REGISTRY_BASE_PATH, inputs.folder, 'openshift-latest') || '' }}