Skip to content

Commit

Permalink
- make deploy job depend on ci
Browse files Browse the repository at this point in the history
- fix secrets as variables
  • Loading branch information
carafelix committed Jun 20, 2024
1 parent bbd50c5 commit 9881f56
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: tests

on:
push:
Expand All @@ -7,9 +7,9 @@ on:
- dev

jobs:
deploy:
tests:
runs-on: ubuntu-latest
name: ci
name: tests
steps:
- uses: actions/checkout@v4
env:
Expand All @@ -18,9 +18,10 @@ jobs:
SUDO_SECRET: ${{ secrets.SUDO_SECRET }}
- run: |
touch .dev.vars
echo SUDO_SECRET="SUDO_SECRET" >> .dev.vars
echo XATA_API_KEY="XATA_API_KEY" >> .dev.vars
echo XATA_DB="XATA_DB" >> .dev.vars
echo SUDO_SECRET="$SUDO_SECRET" >> .dev.vars
echo XATA_API_KEY="$XATA_API_KEY" >> .dev.vars
echo XATA_DB="$XATA_DB" >> .dev.vars
ls
- run: npm install
- run: npm run test

10 changes: 7 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: Deploy

on:
push:
branches:
- main
workflow_run:
workflows: ["Run Tests"]
branches: [main]
types:
- completed


jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
name: Deploy
steps:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"scripts": {
"test": "vitest",
"test": "vitest run",
"deploy": "wrangler deploy",
"dev": "wrangler dev --port 8787",
"cf-typegen": "wrangler types"
Expand Down

0 comments on commit 9881f56

Please sign in to comment.