-
Notifications
You must be signed in to change notification settings - Fork 7
64 lines (61 loc) · 2.08 KB
/
build.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
on:
push:
paths-ignore:
- "**.md"
- "resources/**"
- "**.gitignore"
pull_request:
env:
BUILDKIT_PROGRESS: plain
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ">=1.22.0"
- name: gofmt cache
working-directory: ./frmcache/src/app
run: |
if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then
exit 1
fi
- name: gofmt alertmanager-config
working-directory: ./alertmanager-config/src/app
run: |
if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then
exit 1
fi
test:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ">=1.22.0"
- name: Run tests
working-directory: ./frmcache/src/app
run: go test ./...
push:
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.repository == 'featheredtoast/satisfactory-monitoring'
environment: docker deploy
runs-on: ubuntu-latest
needs: [lint, test]
env:
TAG: ${{ (github.ref == 'refs/heads/main' && 'latest') || (github.ref == 'refs/heads/dev' && 'dev') || '' }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: build images
run: |
docker login --username ${{ vars.DOCKERHUB_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }}
docker buildx build --push --platform linux/amd64,linux/arm64 --tag featheredtoast/ficsit-remote-monitoring-cache:${{ env.TAG }} ./frmcache
docker buildx build --push --platform linux/amd64,linux/arm64 --tag featheredtoast/ficsit-remote-monitoring-alertmanager-config:${{ env.TAG }} ./alertmanager-config
docker buildx build --push --platform linux/amd64,linux/arm64 --tag featheredtoast/ficsit-remote-monitoring-companion:${{ env.TAG }} ./frmcompanion