From 9f2fbc39fb85507f6028438f850b703774ec3f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9B=90=EB=8D=94?= Date: Wed, 13 Jan 2021 21:44:47 +0900 Subject: [PATCH] ci: sperating action and added auto deploy in https://github.com/koreanbots/v2-testing/issues/18 --- .github/workflows/deploy.yml | 63 +++++++++++++++++++++++++++++++++++ .github/workflows/testing.yml | 23 +------------ 2 files changed, 64 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..6a60a46 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,63 @@ +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 + test: + 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 'MYSQL_ROOT_PASSWORD=YOUSHALLNOTPASS' > .env + - name: Create needed files + run: echo '{"tester":"DEMO_KEY"}' > secret.json + - name: Docker Compose + run: docker-compose up -d \ No newline at end of file diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 729dc76..8350cee 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -1,7 +1,6 @@ name: CI on: - pull_request - - push jobs: eslint: name: ESLint @@ -38,24 +37,4 @@ jobs: - name: Build run: yarn build env: - CI: true - test: - 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 'MYSQL_ROOT_PASSWORD=YOUSHALLNOTPASS' > .env - - name: Create needed files - run: echo '{"tester":"DEMO_KEY"}' > secret.json - - name: Docker Compose - run: docker-compose up -d \ No newline at end of file + CI: true \ No newline at end of file