2022-07-29 21:30:16 +08: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 20:55:09 +08:00
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref_name }}
|
2024-01-03 17:42:32 +08:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
id-token: write # needed for signing the images with GitHub OIDC Token
|
2022-07-29 21:30:16 +08:00
|
|
|
jobs:
|
|
|
|
buildx:
|
|
|
|
name: Docker Buildx
|
2024-10-17 18:10:32 +08:00
|
|
|
runs-on: ubuntu-24.04
|
2022-07-29 21:41:05 +08:00
|
|
|
environment: dockerhub
|
2022-07-29 21:30:16 +08:00
|
|
|
steps:
|
2023-09-06 01:31:32 +08:00
|
|
|
- uses: actions/checkout@v4
|
2022-07-29 21:30:16 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0 # needed for docker-package to be able to calculate the version
|
|
|
|
|
2024-01-03 17:42:32 +08:00
|
|
|
- name: Install Cosign
|
2024-11-12 23:31:36 +08:00
|
|
|
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3
|
2024-01-03 17:42:32 +08:00
|
|
|
|
2022-07-29 21:30:16 +08:00
|
|
|
- name: Set up QEMU
|
2024-07-24 19:40:31 +08:00
|
|
|
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
|
2022-07-29 21:30:16 +08:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2024-11-12 23:52:15 +08:00
|
|
|
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
|
2022-07-29 21:30:16 +08:00
|
|
|
with:
|
|
|
|
install: true
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2024-07-24 19:40:31 +08:00
|
|
|
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
|
2022-07-29 21:30:16 +08:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
2024-03-05 22:43:09 +08:00
|
|
|
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
|
2022-07-29 21:30:16 +08:00
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
vectorim/element-web
|
|
|
|
tags: |
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=tag
|
2022-09-14 21:10:12 +08:00
|
|
|
flavor: |
|
|
|
|
latest=${{ contains(github.ref_name, '-rc.') && 'false' || 'auto' }}
|
2022-07-29 21:30:16 +08:00
|
|
|
|
|
|
|
- name: Build and push
|
2024-01-03 17:42:32 +08:00
|
|
|
id: build-and-push
|
2024-10-02 03:09:55 +08:00
|
|
|
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
|
2022-07-29 21:30:16 +08:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: true
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
|
2024-01-03 17:42:32 +08: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 23:56:45 +08:00
|
|
|
images+="${tag}@${DIGEST} "
|
2024-01-03 17:42:32 +08:00
|
|
|
done
|
|
|
|
cosign sign --yes ${images}
|
|
|
|
|
2022-07-29 21:30:16 +08:00
|
|
|
- name: Update repo description
|
2024-02-03 00:46:25 +08:00
|
|
|
uses: peter-evans/dockerhub-description@e98e4d1628a5f3be2be7c231e50981aee98723ae # v4
|
2022-07-29 22:19:51 +08:00
|
|
|
continue-on-error: true
|
2022-07-29 21:30:16 +08:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
repository: vectorim/element-web
|