backend server build #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: backend server build | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: true | |
description: "docker version to release" | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
backend-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: coursier/cache-action@v6 | |
- uses: coursier/setup-action@v1 | |
with: | |
jvm: temurin:1.17 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: 'admin-web/package-lock.json' | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to GithubPackages | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: build | |
run: make release-backend | |
- | |
name: build and push docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: command/docker/backend | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: ${{ env.REGISTRY }}/fornetcode/fornet-backend:${{github.event.inputs.version}}, ${{ env.REGISTRY }}/fornetcode/fornet-backend:latest | |
- name: Upload jar to artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
path: release/* | |
name: backend | |
if-no-files-found: error |