-
Notifications
You must be signed in to change notification settings - Fork 4
105 lines (87 loc) · 3.09 KB
/
continuous-integration.yaml
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
100
101
102
103
104
105
# This workflow performs continuous integration (CI).
# This workflow will build the container image for amd64 arch. (as a basic build test)
name: Continuous Integration (CI)
on:
# On pull-request event with detailed condition below.
pull_request:
branches:
- main
paths-ignore:
- "**.md"
- ".gitignore"
- "LICENSE"
- "CODEOWNERS"
- "assets/**"
- "docs/**"
# - "scripts/**"
# - "src/testclient/scripts/**"
# - ".all-contributorsrc"
jobs:
# The job key (i.e., ID) is "build-source-code"
build-source-code-api-server:
# Job name is "Building source code"
# This job runs on Ubuntu-latest (Ubuntu 22.04 LTS checked on 2023-12-13)
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
name: Build source code for butterfly api
strategy:
matrix:
go-version: ["1.23"]
os: [ubuntu-22.04]
#os: [ubuntu-22.04, ubuntu-20.04, windows-2022, windows-2019]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{matrix.go-version}}
- name: Install Go dependencies
run: go mod download
- name: Install Buffalo CLI
run: go install github.com/gobuffalo/cli/cmd/[email protected]
- name: Build Buffalo application
run: buffalo build --static
# The job key is "build-container-image"
build-container-image-api-server:
# Job name is "Build a container image"
name: Build a container image for butterfly api
# This job runs on Ubuntu-latest (Ubuntu 22.04 LTS checked on 2023-12-13)
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
runs-on: ubuntu-22.04
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Build image
env:
IMAGE_NAME: ${{ github.event.repository.name }}-api
run: docker image build --file ./api/Dockerfile --tag $IMAGE_NAME ./api
build-source-code-front:
name: Build source code for butterfly front
strategy:
matrix:
os: [ubuntu-22.04]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install --legacy-peer-deps --save-prod
working-directory: ./front
- name: Build application
run: npm run build
working-directory: ./front
build-container-image-front:
name: Build a container image for butterfly front
runs-on: ubuntu-22.04
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Build image
env:
IMAGE_NAME: ${{ github.event.repository.name }}-front
run: docker image build --file ./front/Dockerfile --tag $IMAGE_NAME ./front