core/.github/workflows/deploy.yml
Workflow config file is invalid. Please check your config file: yaml: line 64: could not find expected ':'
2021-01-13 22:35:45 +09:00

82 lines
2.2 KiB
YAML

name: Deploy
on:
push:
branches:
- master
- stable
jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install node v14
uses: actions/setup-node@v1
with:
node-version: 14
- name: yarn install
run: yarn install
- name: run eslint
run: yarn lint
env:
CI: true
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install node v14
uses: actions/setup-node@v1
with:
node-version: 14
- name: yarn install
run: yarn install
- name: Generate RSA Key Pair
run: ssh-keygen -b 2048 -t rsa -f key -q -P "" && ssh-keygen -b 2048 -e -m pem -f key -q -P "" > private.key && mv key public.pem && rm key.pub
- name: Setup environments
run: mv .env.demo.local .env.production.local & echo 'MYSQL_ROOT_PASSWORD=YOUSHALLNOTPASS' > .env
- name: Create needed files
run: echo '{"tester":"DEMO_KEY"}' > secret.json
- name: Build
run: yarn build
env:
CI: true
docker:
needs:
- eslint
- build
name: Docker Image CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install node v14
uses: actions/setup-node@v1
with:
node-version: 14
- name: Generate RSA Key Pair
run: |
ssh-keygen -b 2048 -t rsa -f key -q -P ""
ssh-keygen -b 2048 -e -m pem -f key -q -P "" > private.key
mv key public.pem
rm key.pub
- name: Setup environments
run: |
mv .env.demo.local .env.production.local
echo 'MARIADB_ROOT_PASSWORD=YOUSHALLNOTPASS' > .env
- name: Create needed files
run: echo '{"tester":"DEMO_KEY"}' > secret.json
- name: Docker Compose
run: docker-compose up -d
deployBeta:
needs: docker
name: Deploy Beta
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
command: cd ${{ secrets.BETA_DIR }} && git stash && git pull && docker-compose up --build