You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
name: CI
|
|
|
|
# This workflow is triggered on pushes to the repository.
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: golang:1.13
|
|
|
|
env:
|
|
|
|
PROJECT_PATH: /go/src/github.com/analogj/scrutiny
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Build
|
|
|
|
env:
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: amd64
|
|
|
|
run: |
|
|
|
|
mkdir -p $PROJECT_PATH
|
|
|
|
cp -a $GITHUB_WORKSPACE/* $PROJECT_PATH/
|
|
|
|
cd $PROJECT_PATH
|
|
|
|
|
|
|
|
go mod vendor
|
|
|
|
|
|
|
|
go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o scrutiny-web-linux-amd64 -tags "static" webapp/backend/cmd/scrutiny/scrutiny.go
|
|
|
|
go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o scrutiny-collector-metrics-linux-amd64 -tags "static" collector/cmd/collector-metrics/collector-metrics.go
|
|
|
|
|
|
|
|
chmod +x scrutiny-web-linux-amd64
|
|
|
|
chmod +x scrutiny-collector-metrics-linux-amd64
|
|
|
|
- name: Archive
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: binaries
|
|
|
|
path: |
|
|
|
|
${{ env.PROJECT_PATH }}/scrutiny-web-linux-amd64
|
|
|
|
${{ env.PROJECT_PATH }}/scrutiny-collector-metrics-linux-amd64
|
|
|
|
build-docker:
|
|
|
|
name: Build Docker
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: docker:19.03.2
|
|
|
|
steps:
|
|
|
|
- name: Build Docker
|
|
|
|
run: |
|
|
|
|
docker build -t analogj/scrutiny .
|
|
|
|
docker save -o docker-analogj-scrutiny-latest.tar analogj/scrutiny:latest
|
|
|
|
- name: Archive Docker
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: docker
|
|
|
|
path: docker-analogj-scrutiny-latest.tar
|