Skip to content
# 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"
- "docs/**"
- "api/scripts/**"
- "front/scripts/**"
- "*/scripts/**"
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 mc-web-console 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 Buffalo CLI
run: go install github.com/gobuffalo/cli/cmd/[email protected]
- name: Install Go dependencies
run: go mod download
working-directory: ./api
- name: Build Buffalo application
run: buffalo build --static
working-directory: ./api
# 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 mc-web-console 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.mcwebconsoleapi --tag $IMAGE_NAME .
# The job key (i.e., ID) is "build-source-code"
# build-source-code-front-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 mc-web-console front
# 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 Buffalo CLI
# run: go install github.com/gobuffalo/cli/cmd/[email protected]
# - name: Install Go dependencies
# run: go mod download
# working-directory: ./front
# - name: Set up Node.js
# uses: actions/setup-node@v3
# with:
# node-version: '20.17.0'
# - name: Enable Corepack
# run: corepack enable
# - name: Install Yarn 4.1.0
# run: corepack prepare [email protected] --activate
# - name: Install npm dependencies
# run: npm install
# working-directory: ./front
# - name: Clean Yarn cache
# run: yarn cache clean
# working-directory: ./front
# - name: Install Yarn dependencies with cache check
# run: yarn install --immutable
# working-directory: ./front
# - name: Build Buffalo application
# run: buffalo build --static
# working-directory: ./front
# The job key is "build-container-image"
build-container-image-front-server:
# Job name is "Build a container image"
name: Build a container image for mc-web-console front
# 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 }}-front
run: docker image build --file ./front/Dockerfile.mcwebconsolefront --tag $IMAGE_NAME .