Skip to content

Actualize docs

Actualize docs #411

Workflow file for this run

name: CI
on:
- push
jobs:
front-build:
runs-on: ubuntu-latest
env:
PORT: 3000
APP_ID: mockingbird
NODE_ENV: production
RELATIVE_PATH: /mockingbird
ASSETS_FOLDER_NAME: /assets
ASSETS_PREFIX: /mockingbird/assets/
MOCKINGBIRD_API: /api/internal/mockingbird
MOCKINGBIRD_EXEC_API: /api/mockingbird/exec
DEBUG_PLAIN: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Build
run: |
cd frontend
rm ./env.development.js
mkdir -p ./dist/out${ASSETS_FOLDER_NAME}
npm install
npm run build
- name: Copy output
run: |
cd frontend
cp -r ./dist/static${RELATIVE_PATH}/. ./dist/out
cp -a ./dist/client/. ./dist/out${ASSETS_FOLDER_NAME}
- name: Upload output directories
uses: actions/upload-artifact@v3
with:
name: front-static
path: frontend/dist/out
back-build:
needs: [front-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download frontend
uses: actions/download-artifact@v3
with:
name: front-static
path: frontend/dist/out
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
check-latest: true
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.20.0'
- name: Get the Ref
id: get-ref
uses: ankitvgupta/ref-to-tag-action@v1.0.1
with:
ref: ${{ github.ref }}
head_ref: ${{ github.head_ref }}
- name: Compile and test
run: |
cd backend
sbt "project mockingbird-api;clean;fixCheck;test;missinglinkCheck;Docker / stage;"
- name: ZIP stages files
uses: montudor/action-zip@v1
with:
args: zip -r layers.zip ./backend/mockingbird-api/target/docker/stage
if: ${{ github.ref_type == 'tag' }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') }}
- name: Build and push docker image
uses: docker/build-push-action@v3
with:
context: ./backend/mockingbird-api/target/docker/stage
push: true
tags: ghcr.io/tinkoff/mockingbird:${{ steps.get-ref.outputs.tag }}
if: ${{ github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') }}
- name: Publish layers
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: layers.zip
asset_name: layers.zip
tag: ${{ github.ref_name }}
if: ${{ github.ref_type == 'tag' }}
back-build-native:
needs: [front-build]
runs-on: ubuntu-20.04
env:
CI: true
steps:
- uses: actions/checkout@v3
- name: Download frontend
uses: actions/download-artifact@v3
with:
name: front-static
path: frontend/dist/out
- uses: graalvm/setup-graalvm@v1
with:
version: '22.3.1'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.20.0'
- name: Get the Ref
id: get-ref
uses: ankitvgupta/ref-to-tag-action@v1.0.1
with:
ref: ${{ github.ref }}
head_ref: ${{ github.head_ref }}
- name: Compile and test
run: |
cd backend
sbt "project mockingbird-native;clean;fixCheck;test;GraalVMNativeImage / packageBin;Docker / stage;"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') }}
- name: Build and push docker image
uses: docker/build-push-action@v3
with:
context: ./backend/mockingbird-native/target/docker/stage
push: true
tags: ghcr.io/tinkoff/mockingbird:${{ steps.get-ref.outputs.tag }}-native
if: ${{ github.ref_type == 'tag' || startsWith(github.event.head_commit.message, '[docker]') }}