shellphone.app/.github/workflows/main.yml

72 lines
2.1 KiB
YAML
Raw Normal View History

2021-08-20 00:56:07 +00:00
name: Deployment pipeline
2021-08-20 06:28:34 +00:00
on: [push, pull_request]
jobs:
2021-08-20 06:28:34 +00:00
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:
DATOCMS_API_TOKEN: ${{ secrets.DATOCMS_API_TOKEN }}
QUIRREL_BASE_URL: doesntmatter.shellphone.app
deploy_dev:
if: github.ref == 'refs/heads/master'
needs: [lint, test, build]
name: Deploy dev.shellphone.app
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:
2021-08-20 06:41:37 +00:00
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN_DEV }}
2021-08-20 06:28:34 +00:00
deploy_prod:
if: github.ref == 'refs/heads/production'
needs: [lint, test, build]
name: Deploy www.shellphone.app
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:
2021-08-20 06:41:37 +00:00
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN_PROD }}
# TODO: on pull_request, deploy 24hour-long deployment at {commit_short_hash}.shellphone.app, provision db and seed data