* docker: initial config

* docker: add entrypoint for headless run

* docker: resolve path from env variable

* docker: initial config

* docker: rename preloaded data directories

* docker: update README

* docker: prevent issue with port mappings

* docker: update README.md

* docker: add docker-compose

* docker: cleanup logs

* docker: add CI

* docker: cleanup unused

* docker: use static port in development

* refactor: isolate tasks

* docker: add demo db

* fix: download db resolves according to OS

* docker: config build

* fix: ensure db path exists

* fix: add object type to block

* docker: config build

* docker: config build

* docker: env is production

* docker: preload db

* fix: remove test dir

* docker: graceful shutdown node app

* docker: env is production

* docker: add docker-compose

* docker: remove unused mappings

* docker: version bump
This commit is contained in:
Carlos Valente
2022-06-08 21:57:22 +02:00
committed by GitHub
parent 94a7ef6318
commit 9c5c7ee69a
23 changed files with 214 additions and 187 deletions
-103
View File
@@ -1,103 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
push:
# Pattern matched against refs/tags
tags:
# Push events to every tag not containing /
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# build a file for windows
buildwin:
# The type of runner that the job will run on
runs-on: windows-latest
env:
CI: ''
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
# install and build react
- name: Install React dependencies
run: yarn install
working-directory: ./client
- name: Build React App
run: yarn build
working-directory: ./client
# install node dependencies
- name: Install nodejs dependencies
run: yarn install
working-directory: ./server/src
# install and build electron
- name: Install Electron dependencies
run: yarn install
working-directory: ./server
- name: Build Electron App
run: yarn dist-win
working-directory: ./server
# release
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ./server/dist/ontime-win64.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# build a file for mac
# buildmac:
# The type of runner that the job will run on
# runs-on: macOS-latest
# env:
# CI: ''
# Steps represent a sequence of tasks that will be executed as part of the job
# steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# - uses: actions/checkout@v2
# - name: Use Node.js
# uses: actions/setup-node@v1
# with:
# node-version: '14.x'
# install and build react
# - name: Install React dependencies
# run: yarn install
# working-directory: ./client
# - name: Build React App
# run: yarn build
# working-directory: ./client
# install and build electron
# - name: Install Electron + nodejs dependencies
# run: yarn install
# working-directory: ./server
# - name: Build Electron App
# run: yarn dist-win
# working-directory: ./server
# release
# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# files: ./server/dist/ontime-macOS.dmg
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+54 -8
View File
@@ -22,7 +22,7 @@ jobs:
# React
- name: React - Install dependencies
run: yarn install
run: yarn install --frozen-lockfile
working-directory: ./client
- name: React - Build project
@@ -31,13 +31,13 @@ jobs:
# Node server
- name: Server - Install dependencies
run: yarn install
run: yarn install --frozen-lockfile --production
working-directory: ./server/src
# App
- name: Electron - Install dependencies
shell: bash
run: yarn install && yarn setdb
run: yarn install --frozen-lockfile && yarn setdb
working-directory: ./server
- name: Electron - Build app
run: yarn dist-mac
@@ -65,7 +65,7 @@ jobs:
# React
- name: React - Install dependencies
run: yarn install
run: yarn install --frozen-lockfile
working-directory: ./client
- name: React - Build project
@@ -74,13 +74,13 @@ jobs:
# Node server
- name: Server - Install dependencies
run: yarn install
run: yarn install --frozen-lockfile --production
working-directory: ./server/src
# App
- name: Electron - Install dependencies
shell: bash
run: yarn install && yarn setdb
run: yarn install --frozen-lockfile && yarn setdb
working-directory: ./server
- name: Electron - Build app
run: yarn dist-win
@@ -108,7 +108,7 @@ jobs:
# React
- name: React - Install dependencies
run: yarn install
run: yarn install --frozen-lockfile
working-directory: ./client
- name: React - Build project
@@ -117,7 +117,7 @@ jobs:
# Node server
- name: Server - Install dependencies
run: yarn install
run: yarn install --frozen-lockfile --production
working-directory: ./server/src
# App
@@ -136,3 +136,49 @@ jobs:
files: ./server/dist/ontime-linux.AppImage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_docker:
runs-on: ubuntu-latest
env:
CI: ''
steps:
- uses: actions/checkout@v2
- name: Setup env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
# React
- name: React - Install dependencies
run: yarn install
working-directory: ./client
- name: React - Build project
run: yarn build
working-directory: ./client
# Node server
- name: Server - Install dependencies
run: yarn install --frozen-lockfile --production
working-directory: ./server/src
# Login to docker
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Build and push
- name: Build and push
working-directory: ./
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ontime:${{ env.RELEASE_VERSION }}