forked from jitsi/docker-jitsi-meet
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from matrix-org/bbz/update-ghas
Workflow improvements
- Loading branch information
Showing
2 changed files
with
115 additions
and
396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Docker Publish Jitsi Component | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
folder: | ||
required: true | ||
type: string | ||
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@v3 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.github-token }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY_BASE_PATH }}/${{ inputs.folder }} | ||
# Turn off auto-latest, as we want to exclude openshift tags from that | ||
flavor: | | ||
latest=false | ||
# 1-3. Generate the default docker tags, 4. generate latest if git tag is on the default branch, 5. generate openshift-latest if git tag is on the openshift branch | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=ref,event=tag,value=latest,enable={{is_default_branch}} | ||
type=ref,event=tag,value=openshift-latest,enable=${{ github.ref == 'refs/heads/openshift' }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: "${{ inputs.folder }}" | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
"BASE_TAG=${{ env.BASE_TAG }}" | ||
"JITSI_REPO=${{ env.REGISTRY_BASE_PATH }}" | ||
if: contains(github.ref_name, '/merge') == false | ||
|
||
- name: Build and push Docker image for PR | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: "${{ inputs.folder }}" | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
"BASE_TAG=${{ github.base_ref }}" | ||
"JITSI_REPO=${{ env.REGISTRY_BASE_PATH }}" | ||
if: contains(github.ref_name, '/merge') |
Oops, something went wrong.