mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-01 13:31:04 -05:00
7320fe2ac1
This is an import of 166ca8da12
with some changes to make it fit into the mono repo.
- TypedEventEmitter has been replaced with EventEmitter2 because EventEmitter2 is faster and TypedEventEmitter had some troubles with the new way of compiling.
- tsc-esm has been replaced with microbundle. The problems that lib0 doesn't export its types correctly has been solved using yarn patch.
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
90 lines
2.5 KiB
YAML
90 lines
2.5 KiB
YAML
# SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
name: Frontend / build docker image
|
|
|
|
on:
|
|
push:
|
|
branches: [ develop ]
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: frontend
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
changes:
|
|
name: Check for frontend changes
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: read
|
|
outputs:
|
|
changed: ${{ github.event_name == 'push' || steps.changed.outputs.files }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
if: github.event_name != 'push'
|
|
|
|
- name: Check for frontend file changes
|
|
if: github.event_name != 'push'
|
|
uses: dorny/paths-filter@v2
|
|
id: changed
|
|
with:
|
|
filters: |
|
|
files:
|
|
- 'commons/**'
|
|
- 'frontend/**'
|
|
- '.github/**'
|
|
- '.yarn/**'
|
|
|
|
build:
|
|
needs: changes
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
if: needs.changes.outputs.changed == 'true'
|
|
|
|
- name: Generate Docker metadata
|
|
if: needs.changes.outputs.changed == 'true'
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
|
|
- name: Set up QEMU
|
|
if: needs.changes.outputs.changed == 'true'
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
if: needs.changes.outputs.changed == 'true'
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to GHCR
|
|
if: github.event_name != 'pull_request' && needs.changes.outputs.changed == 'true'
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
if: needs.changes.outputs.changed == 'true'
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
push: true
|
|
file: frontend/docker/Dockerfile
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
context: .
|
|
build-args: |
|
|
BUILD_VERSION=${{ github.event.head_commit.id }}
|