-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (33 loc) · 1.02 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
name: Deploy
on: [push]
jobs:
build:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout code"
uses: "actions/checkout@v2"
- uses: actions/setup-go@v2
with:
go-version: '^1.22'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Prep binary dirs
run: |
mkdir -p linux/amd64
mkdir -p linux/arm64
- name: Build amd64 binary
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 0
run: go build -o linux/amd64/main main.go
- name: Build arm64 binary
env:
GOOS: linux
GOARCH: arm64
CGO_ENABLED: 0
run: go build -o linux/arm64/main main.go
- name: Docker login
run: echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io --username lispyclouds --password-stdin
- name: Build and push image
run: docker buildx build --push --platform linux/amd64,linux/arm64 -t ghcr.io/bob-cd/artifact-local:latest .