-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (92 loc) · 2.96 KB
/
push.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Push workflow
on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os:
- linux
arch:
- amd64
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
with:
go-version: ">=1.18.0"
- name: Run build
run: go build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ">=1.18.0"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.46.2
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
with:
go-version: ">=1.18.0"
- name: Run tests
run: go test ./... -v
# docker-build-push:
# name: Build and push Docker image
# needs: [build, lint, test]
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: Login to Scaleway Container Registry
# uses: docker/login-action@v2
# with:
# registry: rg.fr-par.scw.cloud/tereus-registry
# username: nologin
# password: ${{ secrets.SCW_SECRET_KEY }}
# - name: Build and push
# uses: docker/build-push-action@v2
# with:
# push: true
# tags: |
# rg.fr-par.scw.cloud/tereus-registry/transpiler-c-go:latest
# deploy-scw:
# name: Deploy app to Scaleway CaaS
# needs: [docker-build-push]
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
# steps:
# - name: Install scw-cli
# run: |
# sudo curl -o /usr/local/bin/scw -L "https://github.com/scaleway/scaleway-cli/releases/download/v2.5.3/scaleway-cli_2.5.3_linux_amd64"
# sudo chmod +x /usr/local/bin/scw
# scw version
# - name: Init scw-cli
# run: |
# scw init secret-key=${{ secrets.SCW_SECRET_KEY }} access-key=${{ secrets.SCW_ACCESS_KEY }} send-telemetry=false install-autocomplete=false with-ssh-key=false region=fr-par zone=fr-par-1
# - name: Deploy app
# run: scw container container deploy ${{ secrets.SCW_CT_ID }}
# deploy-fly:
# name: Deploy app to fly
# needs: [build, lint, test]
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
# steps:
# - uses: actions/checkout@v2
# - uses: superfly/flyctl-actions/setup-flyctl@master
# - run: flyctl deploy --remote-only
# env:
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}