-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (72 loc) · 2.35 KB
/
ci.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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare
id: prep
run: |
TAG=$(echo $GITHUB_SHA | head -c7)
echo ::set-output name=tag::${TAG}
- name: Login to GitHub package docker registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | \
docker login --username ${{ github.actor }} --password-stdin ghcr.io
- uses: actions/setup-go@v3
with:
# Installs the go version specified in go.mod
go-version-file: 'go.mod'
cache: true
- name: Install protobuf-compiler
run: sudo apt install -y libprotobuf-dev protobuf-compiler
- uses: denoland/setup-deno@v1
with:
deno-version: v1.29.1
- name: Fetch Flow
run: |
mkdir $HOME/bin \
&& curl -L --proto '=https' --tlsv1.2 -sSf "https://github.com/estuary/flow/releases/download/dev/flow-x86-linux.tar.gz" \
| tar -zx -C $HOME/bin
- name: Setup Protobuf Tools
run: make protobuf_tools
- name: Add GOBIN to PATH
run: echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Install Go deps
run: go mod download
- name: Build
run: make && go build -o $HOME/bin/data-plane-gateway .
- name: Ensure that generated files are unchanged.
run: |
git status \
&& git diff \
&& [[ -z "$(git status --porcelain)" ]] || exit 1
- name: Run Tests
run: ./test.sh run $HOME/bin/data-plane-gateway $HOME/bin/flowctl-go
- name: Build Docker Image
uses: docker/build-push-action@v2
with:
context: .
load: true
tags: ghcr.io/estuary/data-plane-gateway:dev
- name: Push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/estuary/data-plane-gateway:${{ steps.prep.outputs.tag }}
- name: Push Docker image with 'dev' tag
if: ${{ github.event_name == 'push' }}
uses: docker/build-push-action@v2
with:
context: .
push: true # See 'if' above
tags: ghcr.io/estuary/data-plane-gateway:dev