-
Notifications
You must be signed in to change notification settings - Fork 7
59 lines (53 loc) · 1.49 KB
/
pipeline.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
name: Linting and Tests
on:
push:
branches: ["main"]
pull_request:
jobs:
run-unit-tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
- run: yarn
- run: yarn test
build:
name: Build JSONSchema, TypeScript and Web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
- run: yarn
- run: yarn build
build-docker:
name: Build Docker Image
runs-on: ubuntu-latest
env:
# Only push if this is develop, otherwise we just want to build
# On a PR github.ref is the target branch, so don't push for that either
PUSH: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
steps:
- name: Check out
uses: actions/checkout@v2
- name: Login to GHCR
uses: docker/login-action@v3
if: ${{ env.PUSH == 'true' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: ${{ env.PLATFORMS }}
push: ${{ env.PUSH }}
tags: |
ghcr.io/matrix-org/conference-bot:latest
ghcr.io/matrix-org/conference-bot:${{ github.sha }}