Skip to content

Merge pull request #30 from justinfarrelldev/staging #97

Merge pull request #30 from justinfarrelldev/staging

Merge pull request #30 from justinfarrelldev/staging #97

Workflow file for this run

name: Deploy to Preview
on:
push:
branches:
- staging
- main
jobs:
test:
name: Test App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache npm dependencies
uses: actions/cache@v3
with:
path: ~/.npm # Cache location
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} # Cache key
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test
deploy:
name: Deploy App to Production
needs: test
runs-on: ubuntu-latest
concurrency: deploy-group # optional: ensure only one action runs at a time
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: npm run deploy
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}