add github actions to lint, test, compile and deploy to railway
This commit is contained in:
parent
11a832058d
commit
30eebe246e
54
.github/workflows/main.yml
vendored
Normal file
54
.github/workflows/main.yml
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
name: Deploy to Railway
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- run: npm install
|
||||||
|
- run: npm run lint
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- run: npm install
|
||||||
|
- run: npm test
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Compile
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- run: npm install
|
||||||
|
- run: npm run build
|
||||||
|
env:
|
||||||
|
QUIRREL_BASE_URL: "doesntmatter.shellphone.app"
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
if: contains('refs/heads/master refs/heads/production', github.ref)
|
||||||
|
needs: [lint, test, build]
|
||||||
|
name: Deploy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
- run: npm i -g @railway/cli
|
||||||
|
- run: railway up
|
||||||
|
env:
|
||||||
|
RAILWAY_TOKEN: "${{ github.ref }} === 'refs/heads/master' ? '${{ secrets.RAILWAY_TOKEN_PROD }}' : '${{ secrets.RAILWAY_TOKEN_DEV }}'"
|
Loading…
Reference in New Issue
Block a user