-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (51 loc) · 1.27 KB
/
build.yml
File metadata and controls
52 lines (51 loc) · 1.27 KB
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
name: Build and Test
on:
push:
tags:
- v*
branches:
- develop
- main
pull_request:
permissions:
contents: read
pull-requests: read
env:
__W_SRC_REL: go/src/github.com/RocketChat/airlock
jobs:
build-and-test:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
path: ${{ env.__W_SRC_REL }}
- uses: actions/setup-go@v3
with:
go-version: '=1.21.0'
cache: false
- uses: RocketChat/k3d-with-registry@main
- name: Build binary
env:
CI: true
run: |
cd $__W_SRC_REL
go mod tidy
make build
make docker-build-no-test IMG=controller:latest
make test
- name: Login to Docker Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERREGISTRY_USERNAME }}
password: ${{ secrets.DOCKERREGISTRY_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ${{ env.__W_SRC_REL }}
file: ${{ env.__W_SRC_REL }}/Dockerfile
platforms: linux/amd64
push: true
tags: |
rocketchat/airlock:${{github.sha}}