2022-07-29 16:30:16 +03:00
|
|
|
name: Dockerhub
|
|
|
|
on:
|
|
|
|
workflow_dispatch: {}
|
|
|
|
push:
|
|
|
|
tags: [v*]
|
|
|
|
schedule:
|
|
|
|
# This job can take a while, and we have usage limits, so just publish develop only twice a day
|
|
|
|
- cron: "0 7/12 * * *"
|
2023-03-30 15:55:09 +03:00
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref_name }}
|
2024-01-03 12:42:32 +03:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
id-token: write # needed for signing the images with GitHub OIDC Token
|
2022-07-29 16:30:16 +03:00
|
|
|
jobs:
|
|
|
|
buildx:
|
|
|
|
name: Docker Buildx
|
|
|
|
runs-on: ubuntu-latest
|
2022-07-29 16:41:05 +03:00
|
|
|
environment: dockerhub
|
2023-11-06 14:01:02 +03:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- variant: vanilla
|
|
|
|
# Variant we ship to aid ESS in providing a build on the OpenCoDE platform including specific modules
|
|
|
|
- variant: opendesk
|
|
|
|
flavor: suffix=-opendesk,onlatest=true
|
|
|
|
prepare: mv variants/openDesk/* .
|
2022-07-29 16:30:16 +03:00
|
|
|
steps:
|
2023-09-05 20:31:32 +03:00
|
|
|
- uses: actions/checkout@v4
|
2022-07-29 16:30:16 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0 # needed for docker-package to be able to calculate the version
|
|
|
|
|
2024-01-03 12:42:32 +03:00
|
|
|
- name: Install Cosign
|
|
|
|
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3
|
|
|
|
|
2023-11-06 14:01:02 +03:00
|
|
|
- name: Prepare
|
|
|
|
if: matrix.prepare
|
|
|
|
run: ${{ matrix.prepare }}
|
|
|
|
|
2022-07-29 16:30:16 +03:00
|
|
|
- name: Set up QEMU
|
2023-09-22 03:23:41 +03:00
|
|
|
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3
|
2022-07-29 16:30:16 +03:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2024-04-16 15:43:04 +03:00
|
|
|
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3
|
2022-07-29 16:30:16 +03:00
|
|
|
with:
|
|
|
|
install: true
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2024-06-06 13:16:13 +03:00
|
|
|
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3
|
2022-07-29 16:30:16 +03:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
2024-03-05 17:43:09 +03:00
|
|
|
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
|
2022-07-29 16:30:16 +03:00
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
vectorim/element-web
|
|
|
|
tags: |
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=tag
|
2022-09-14 16:10:12 +03:00
|
|
|
flavor: |
|
|
|
|
latest=${{ contains(github.ref_name, '-rc.') && 'false' || 'auto' }}
|
2023-11-06 14:01:02 +03:00
|
|
|
${{ matrix.flavor }}
|
2022-07-29 16:30:16 +03:00
|
|
|
|
|
|
|
- name: Build and push
|
2024-01-03 12:42:32 +03:00
|
|
|
id: build-and-push
|
2024-06-11 15:43:35 +03:00
|
|
|
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
|
2022-07-29 16:30:16 +03:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: true
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
|
2024-01-03 12:42:32 +03:00
|
|
|
- name: Sign the images with GitHub OIDC Token
|
|
|
|
env:
|
|
|
|
DIGEST: ${{ steps.build-and-push.outputs.digest }}
|
|
|
|
TAGS: ${{ steps.meta.outputs.tags }}
|
|
|
|
run: |
|
|
|
|
images=""
|
|
|
|
for tag in ${TAGS}; do
|
2024-05-08 18:56:45 +03:00
|
|
|
images+="${tag}@${DIGEST} "
|
2024-01-03 12:42:32 +03:00
|
|
|
done
|
|
|
|
cosign sign --yes ${images}
|
|
|
|
|
2022-07-29 16:30:16 +03:00
|
|
|
- name: Update repo description
|
2023-11-09 19:27:01 +03:00
|
|
|
if: matrix.variant == 'vanilla'
|
2024-02-02 19:46:25 +03:00
|
|
|
uses: peter-evans/dockerhub-description@e98e4d1628a5f3be2be7c231e50981aee98723ae # v4
|
2022-07-29 17:19:51 +03:00
|
|
|
continue-on-error: true
|
2022-07-29 16:30:16 +03:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
repository: vectorim/element-web
|