Skip to content

fix: Docker build using dist folder #8

fix: Docker build using dist folder

fix: Docker build using dist folder #8

name: Server CI Enterprise
on:
workflow_dispatch:
push:
branches:
- release-*
tags:
- v*
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
cache-dependency-path: server/go.mod
- 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
cp -r dist build/
- 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:
context: build
file: build/Dockerfile
build-args:
MM_PACKAGE=file://./dist/mattermost-enterprise-linux-amd64.tar.gz
platforms: linux/amd64
push: ${{ github.ref == 'refs/tags/v*' }}
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}