Skip to content

fix: Go setup

fix: Go setup #7

name: Server CI Enterprise
on:
workflow_dispatch:
push:
branches:
- release-*
jobs:
build-server:
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: webapp/package-lock.json
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: server/.go-version
- name: Configure Enterprise mode
run: |
mkdir -p ../enterprise-dir/imports ../enterprise-dir/cloud/config
cp enterprise/placeholder.go ../enterprise-dir/imports/imports.go
touch ../enterprise-dir/ENTERPRISE-EDITION-LICENSE.txt
touch ../enterprise-dir/cloud/config/cloud_defaults.json
- name: Build
env:
BUILD_NUMBER: ${{ github.ref_name }}-${{ github.run_number }}
BUILD_ENTERPRISE_DIR: ../enterprise-dir
run: |
make config-reset
make build-cmd
make package
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
build-contexts: |
build
dist
file: build/Dockerfile
build-args:
MM_PACKAGE=file://./mattermost-enterprise-linux-amd64.tar.gz
platforms: linux/amd64
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}