mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
71 lines
1.6 KiB
YAML
71 lines
1.6 KiB
YAML
name: Build binaries
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-binaries:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.17
|
|
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: JS Dependency Cache
|
|
id: js-cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
**/node_modules
|
|
# Use a separate cache for this from other JS jobs since we run the
|
|
# webpack steps and will have more to cache.
|
|
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node_modules-
|
|
|
|
- name: Go Cache
|
|
id: go-cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
# In order:
|
|
# * Module download cache
|
|
# * Build cache (Linux)
|
|
# * Build cache (Mac)
|
|
# * Build cache (Windows)
|
|
path: |
|
|
~/go/pkg/mod
|
|
~/.cache/go-build
|
|
~/Library/Caches/go-build
|
|
%LocalAppData%\go-build
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Install JS Dependencies
|
|
if: steps.js-cache.outputs.cache-hit != 'true'
|
|
run: make deps-js
|
|
|
|
- name: Install Go Dependencies
|
|
if: steps.go-cache.outputs.cache-hit != 'true'
|
|
run: make deps-go
|
|
|
|
- name: Generate static files
|
|
run: |
|
|
export PATH=$PATH:~/go/bin
|
|
make generate
|
|
|
|
- name: Build binaries
|
|
run: make
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: build
|
|
path: build/ |