-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.29 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- 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
- name: Install Go deps
run: go mod download
- name: Build
run: go build -o data-plane-gateway
- 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