-
Notifications
You must be signed in to change notification settings - Fork 2
85 lines (69 loc) · 2.22 KB
/
ci.yml
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
name: CI
# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]
tags:
- "v*"
workflow_dispatch:
# INFO: The following configuration block ensures that only one build runs per branch,
# which may be desirable for projects with a costly build process.
# Remove this block from the CI workflow to let each CI job run to completion.
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: General linting steps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- name: nix flake check
run: nix flake check
build:
name: Haskell build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- name: Build
run: nix develop --command bash -c "cabal build all"
- name: Run tests
run: nix develop --command bash -c "cabal test all"
- name: Check cabal file
run: nix develop --command bash -c "cabal check"
publish:
name: Build and push docker image
# needs : build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v27
- name: Set tag output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT
- name: Check tag
run: echo ${TAG}
env:
TAG: ${{ steps.vars.outputs.tag }}
- name: Build and import image
run: |
nix build .\#dockerImage -o image.tgz
docker load -i image.tgz
docker tag ldap-scim-bridge:build ldap-scim-bridge:$TAG
env:
TAG: ${{ steps.vars.outputs.tag }}
- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ldap-scim-bridge
tags: ${{ steps.vars.outputs.tag }}
registry: quay.io/wire
username: wire+ldapscimbridge
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"