-
Notifications
You must be signed in to change notification settings - Fork 41
34 lines (34 loc) · 1.33 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
name: Build
run-name: Build all
on: [push]
jobs:
build:
runs-on: ubuntu-latest
environment: build
steps:
- uses: actions/checkout@v4
- run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV && \
wget -q https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz && \
sudo tar -xf go1.13.4.linux-amd64.tar.gz && \
sudo mv go /usr/local && \
echo "GOPATH=$HOME/go" >> $GITHUB_ENV && \
echo "GOROOT=/usr/local/go" >> $GITHUB_ENV && \
echo "PATH=$GOPATH/bin:$GOROOT/bin:$PATH" >> $GITHUB_ENV && \
mkdir -p $HOME/go/src && \
mkdir -p $HOME/go/bin && \
go get "github.com/gobuffalo/packr/v2/packr2"
id: prepare_backend
- uses: actions/setup-node@v4
with:
node-version: '16.x'
- run: cd webmanager && npm install && npm run-script build-prod && cd ..
id: build_frontend
- run: make
id: build_backend
if: ${{ success() }}
- name: Upload artifacts
id: upload
env:
UPLOAD_KEY: ${{ secrets.UPLOAD_KEY }}
if: ${{ success() }}
run: cd dist && find * -type f -exec echo 'Uploading @{}' \; -exec curl -4 -F 'file=@{}' -F "path=$branch/{}" -F "key=$UPLOAD_KEY" "${{ vars.UPLOAD_URL }}" \;;