-
-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (89 loc) · 3.29 KB
/
lexbox-fw-headless.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Build FwHeadless
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
on:
workflow_call:
inputs:
version:
description: 'The version of the image to build'
required: true
type: string
label-latest:
description: 'The label to apply to the latest image'
type: boolean
default: false
env:
IMAGE_NAME: ghcr.io/sillsdev/lexbox-fw-headless
jobs:
publish-fw-headless:
timeout-minutes: 60
runs-on: ubuntu-latest
# postgres db is for automated tests
# services:
# postgres:
# image: postgres:15-alpine
# env:
# POSTGRES_PASSWORD: 972b722e63f549938d07bd8c4ee5086c
# POSTGRES_DB: lexbox-tests
# # Set health checks to wait until postgres has started
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
# ports:
# # Maps tcp port 5432 on service container to the host
# - 5433:5432
env:
# https://docs.docker.com/develop/develop-images/build_enhancements/
DOCKER_BUILDKIT: 1
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'
- name: Dotnet build
run: dotnet build backend/FwHeadless/FwHeadless.csproj
# TODO: Write FwHeadless unit tests, probably based on existing sync tests
# - name: Unit tests
# run: dotnet test backend/FwHeadless/FwHeadless.csproj --logger:"xunit;LogFileName={assembly}.results.xml" --results-directory ./test-results --filter "Category!=Integration&Category!=FlakyIntegration" --blame-hang-timeout 10m
# - name: Publish unit test results
# uses: EnricoMi/publish-unit-test-result-action@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0
# if: always()
# with:
# check_name: C# Unit Tests
# files: ./test-results/*.xml
# - name: Upload test results
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: dotnet-unit-test-results
# path: ./test-results
- name: Docker meta
id: meta
if: ${{ !env.ACT }}
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=raw,enable=${{ inputs.label-latest }},value=latest
type=raw,value=${{ inputs.version }}
- name: ghcr.io login
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
if: ${{ !env.ACT }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: backend
file: backend/FwHeadless/Dockerfile
build-args: |
APP_VERSION=${{ inputs.version }}
push: ${{ !env.ACT && github.repository == 'sillsdev/languageforge-lexbox' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}