-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (46 loc) · 1.11 KB
/
build.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
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.19.0'
cache: false
- name: Build binary
run: |
cd $__W_SRC_REL
go mod tidy
make build
- 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}}