mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 14:30:22 +00:00
90 lines
2.5 KiB
YAML
90 lines
2.5 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- 'stable'
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
jobs:
|
|
eslint:
|
|
name: ESLint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: install node v14
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 14
|
|
- name: yarn install
|
|
run: yarn install
|
|
- name: run eslint
|
|
run: yarn lint
|
|
env:
|
|
CI: true
|
|
test:
|
|
name: Run Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: install node v14
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 14
|
|
- name: yarn install
|
|
run: yarn install
|
|
- name: Setup MySQL
|
|
uses: getong/mariadb-action@v1.1
|
|
with:
|
|
mysql database: 'discordbots'
|
|
mysql root password: 'test'
|
|
- name: Run Jest
|
|
run: yarn test
|
|
- 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
|
|
printf 'MARIADB_ROOT_PASSWORD=YOUSHALLNOTPASS\nCOMMIT_HASH=${{ github.sha }}' > .env
|
|
printf 'defaults.url=https://sentry.io/\ndefaults.org=koreanbots\ndefaults.project=client' > sentry.properties
|
|
- name: Build
|
|
run: yarn build
|
|
env:
|
|
CI: true
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
|
|
|
# docker:
|
|
# needs:
|
|
# - eslint
|
|
# - build
|
|
# - test
|
|
# 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
|
|
# printf 'MARIADB_ROOT_PASSWORD=YOUSHALLNOTPASS\nCOMMIT_HASH=${{ github.sha }}' > .env
|
|
# - name: Create needed files
|
|
# run: echo '{"tester":"DEMO_KEY"}' > secret.json
|
|
# - name: Docker Compose
|
|
# run: docker-compose up -d
|