CI setup w/ self-hosted drone & github actions.

This commit is contained in:
2021-01-03 16:32:06 +01:00
parent 0adf79846e
commit ba041d4fe2
2 changed files with 80 additions and 0 deletions

51
.drone.yml Normal file
View File

@@ -0,0 +1,51 @@
---
kind: pipeline
type: docker
name: blog_kevins-lab
platform:
os: linux
arch: amd64
steps:
- name: frontend_install
image: node:14
commands:
- node -v
- yarn --version
- name: backend_build
image: node:14
commands:
- node -v
- yarn --version
- yarn
- yarn build
- name: deploy
image: appleboy/drone-ssh
pull: true
secrets:
- ssh_key
when:
event:
- push
branch:
- main
- drone-test
status: success
settings:
host: 10.0.0.58
username: root
key:
from_secret: ssh_key
command_timeout: 600s
script:
- /root/blog-deploy.sh
trigger:
branch:
- main
event:
include:
- pull_request
- push

29
.github/workflows/node.js.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
# This workflow will do a clean install of node dependencies and builds the frontend source code across different versions of node.
# It should also run backend tests.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: github actions build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn build