2022-08-05 15:19:18 +02:00
|
|
|
name: Deploy to Docker Hub / GHCR
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
tags:
|
|
|
|
- "v*.*.*"
|
|
|
|
|
2023-01-17 11:29:54 +01:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2023-01-17 11:56:19 +01:00
|
|
|
packages: write
|
2023-01-17 11:29:54 +01:00
|
|
|
|
2022-08-05 15:19:18 +02:00
|
|
|
jobs:
|
|
|
|
server:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check Out Repo
|
2023-09-04 22:25:17 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-08-05 15:19:18 +02:00
|
|
|
|
2022-12-23 22:51:51 +01:00
|
|
|
- name: Set up QEMU
|
2023-09-12 22:16:05 +02:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-12-23 22:51:51 +01:00
|
|
|
|
2022-08-05 15:19:18 +02:00
|
|
|
- name: Generate Docker metadata
|
|
|
|
id: meta
|
2023-09-12 22:16:03 +02:00
|
|
|
uses: docker/metadata-action@v5
|
2022-08-05 15:19:18 +02:00
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
strukturag/nextcloud-spreed-signaling
|
|
|
|
ghcr.io/strukturag/nextcloud-spreed-signaling
|
|
|
|
tags: |
|
|
|
|
type=ref,event=branch
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
type=sha,prefix=
|
|
|
|
- name: Cache Docker layers
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
|
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-buildx-
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
if: github.event_name != 'pull_request'
|
2023-09-12 22:16:08 +02:00
|
|
|
uses: docker/login-action@v3
|
2022-08-05 15:19:18 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
|
|
|
|
- name: Login to GHCR
|
|
|
|
if: github.event_name != 'pull_request'
|
2023-09-12 22:16:08 +02:00
|
|
|
uses: docker/login-action@v3
|
2022-08-05 15:19:18 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2023-09-13 13:20:22 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-08-05 15:19:18 +02:00
|
|
|
|
|
|
|
- name: Build and push
|
|
|
|
id: docker_build
|
2023-09-13 22:30:07 +02:00
|
|
|
uses: docker/build-push-action@v5
|
2022-08-05 15:19:18 +02:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./docker/server/Dockerfile
|
2022-12-23 22:51:51 +01:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-08-05 15:19:18 +02:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
|
|
|
|
|
|
- name: Image digest
|
|
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
|
|
|
|
|
|
proxy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check Out Repo
|
2023-09-04 22:25:17 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-08-05 15:19:18 +02:00
|
|
|
|
2022-12-23 22:51:51 +01:00
|
|
|
- name: Set up QEMU
|
2023-09-12 22:16:05 +02:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-12-23 22:51:51 +01:00
|
|
|
|
2022-08-05 15:19:18 +02:00
|
|
|
- name: Generate Docker metadata
|
|
|
|
id: meta
|
2023-09-12 22:16:03 +02:00
|
|
|
uses: docker/metadata-action@v5
|
2022-08-05 15:19:18 +02:00
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
strukturag/nextcloud-spreed-signaling
|
|
|
|
ghcr.io/strukturag/nextcloud-spreed-signaling
|
|
|
|
labels: |
|
|
|
|
org.opencontainers.image.title=nextcloud-spreed-signaling-proxy
|
|
|
|
org.opencontainers.image.description=Signaling proxy for the standalone signaling server for Nextcloud Talk.
|
2023-03-13 16:05:23 +01:00
|
|
|
flavor: |
|
|
|
|
suffix=-proxy,onlatest=true
|
2022-08-05 15:19:18 +02:00
|
|
|
tags: |
|
2023-03-13 16:05:23 +01:00
|
|
|
type=ref,event=branch
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
type=sha,prefix=
|
2022-08-05 15:19:18 +02:00
|
|
|
- name: Cache Docker layers
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
|
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-buildx-
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
if: github.event_name != 'pull_request'
|
2023-09-12 22:16:08 +02:00
|
|
|
uses: docker/login-action@v3
|
2022-08-05 15:19:18 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
|
|
|
|
- name: Login to GHCR
|
|
|
|
if: github.event_name != 'pull_request'
|
2023-09-12 22:16:08 +02:00
|
|
|
uses: docker/login-action@v3
|
2022-08-05 15:19:18 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2023-09-13 13:20:22 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-08-05 15:19:18 +02:00
|
|
|
|
|
|
|
- name: Build and push
|
|
|
|
id: docker_build
|
2023-09-13 22:30:07 +02:00
|
|
|
uses: docker/build-push-action@v5
|
2022-08-05 15:19:18 +02:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./docker/proxy/Dockerfile
|
2022-12-23 22:51:51 +01:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-08-05 15:19:18 +02:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
|
|
|
|
|
|
- name: Image digest
|
|
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|