mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 05:41:57 -04:00

Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de> Co-authored-by: David Mehren <git@herrmehren.de> Co-authored-by: Erik Michelson <github@erik.michelson.eu> Signed-off-by: Erik Michelson <github@erik.michelson.eu> Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
89 lines
3.1 KiB
YAML
89 lines
3.1 KiB
YAML
# SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
name: Docker
|
|
|
|
on:
|
|
push:
|
|
branches: [ develop ]
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
|
|
|
- name: Generate Docker metadata for backend
|
|
id: meta-backend
|
|
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0
|
|
with:
|
|
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/backend
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
|
|
- name: Generate Docker metadata for frontend
|
|
id: meta-frontend
|
|
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0
|
|
with:
|
|
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/frontend
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@15c905b16b06416d2086efa066dd8e3a35cc7f98 # v2.4.0
|
|
|
|
- name: Login to GHCR
|
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push backend
|
|
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
|
|
with:
|
|
push: true
|
|
file: backend/docker/Dockerfile
|
|
tags: ${{ steps.meta-backend.outputs.tags }}
|
|
labels: ${{ steps.meta-backend.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
context: .
|
|
build-args:
|
|
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
|
TURBO_API: "${{ vars.TURBO_API }}"
|
|
TURBO_TEAM: "${{ vars.TURBO_TEAM }}"
|
|
|
|
- name: Build and push frontend
|
|
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
|
|
with:
|
|
push: true
|
|
file: frontend/docker/Dockerfile
|
|
tags: ${{ steps.meta-frontend.outputs.tags }}
|
|
labels: ${{ steps.meta-frontend.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
context: .
|
|
build-args:
|
|
BUILD_VERSION: "${{ github.event.head_commit.id }}"
|
|
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
|
TURBO_API: "${{ vars.TURBO_API }}"
|
|
TURBO_TEAM: "${{ vars.TURBO_TEAM }}"
|