Adding .env to yml for test #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Server Test | |
on: | |
push: | |
branches: | |
- main # Adjust this according to your default branch name | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
cd server | |
npm install | |
- name: Run tests | |
run: | | |
cd server | |
touch .env | |
echo "DB_URL=${{ secrets.DB_URL }}" >> .env | |
echo "DB_SERVICE_ROLE_KEY=${{ secrets.DB_SERVICE_ROLE_KEY }}" >> .env | |
npm test | |
- name: Remove .env | |
run: | | |
cd server | |
rm .env |