测试自动构建
parent
06f1b5bc62
commit
9cb68397b9
@ -0,0 +1,53 @@
|
||||
name: DockerBuild
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node_version: '13.x'
|
||||
- run: |
|
||||
yarn
|
||||
yarn add webpack webpack-cli -D
|
||||
yarn build
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: hydro
|
||||
path: dist
|
||||
- run: |
|
||||
cd ui
|
||||
yarn
|
||||
yarn add webpack webpack-cli -D
|
||||
yarn build
|
||||
cd ..
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: .uibuild
|
||||
path: .uibuild
|
||||
- run: |
|
||||
yarn add pkg -D
|
||||
yarn run pack
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Hydro_linux_amd64
|
||||
path: hydro-linux
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Hydro_macos_amd64
|
||||
path: hydro-macos
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Hydro_win_amd64.exe
|
||||
path: hydro-win.exe
|
||||
- uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: hydrooj/hydro:alpine
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
dockerfile: Dockerfile
|
@ -0,0 +1,7 @@
|
||||
FROM mhart/alpine-node:slim-10
|
||||
WORKDIR /app
|
||||
ADD .uibuild dist locales templates /app/
|
||||
RUN mkdir /config
|
||||
VOLUME [ "/config" ]
|
||||
EXPOSE 8888
|
||||
CMD ["node", "dist/development.js"]
|
@ -0,0 +1,16 @@
|
||||
version: '3'
|
||||
services:
|
||||
hydro:
|
||||
image: hydrooj/hydro:latest
|
||||
restart: always
|
||||
links:
|
||||
- mongo
|
||||
volumes:
|
||||
- ./config.yaml:/config/config.yaml
|
||||
ports:
|
||||
- 8888:8888
|
||||
mongo:
|
||||
image: mongo:latest
|
||||
restart: always
|
||||
volumes:
|
||||
- ./db:/data/db
|
@ -0,0 +1,16 @@
|
||||
const config = {
|
||||
mode: 'production',
|
||||
entry: {
|
||||
development: './hydro/development.js',
|
||||
install: './hydro/install.js',
|
||||
uninstall: './hydro/uninstall.js'
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: __dirname + '/dist'
|
||||
},
|
||||
target: 'node',
|
||||
module: {}
|
||||
};
|
||||
|
||||
module.exports = config;
|
Loading…
Reference in New Issue