-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (60 loc) · 1.84 KB
/
ci.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Network Tunnel
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build_network_tunnel:
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
strategy:
fail-fast: false
steps:
- 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}
# Linux builds need the non-default musl target.
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl
- name: Install protobuf compiler (it's not already included in CI runner)
run: sudo apt install -y libprotobuf-dev protobuf-compiler
- name: Build Linux
run: |-
sudo apt-get update && \
sudo apt-get install -y musl-tools && \
make
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
platforms: linux/amd64
context: .
push: true
tags: ghcr.io/estuary/network-tunnel:dev,ghcr.io/estuary/network-tunnel:${{ steps.prep.outputs.tag }}
- name: Build and push
uses: docker/build-push-action@v3
if: ${{ github.ref != 'refs/heads/main' }}
with:
platforms: linux/amd64
context: .
push: true
tags: ghcr.io/estuary/network-tunnel:${{ steps.prep.outputs.tag }}