JacobNiyazov is running Back End Test Cases Develop #112
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: Back End Tests | |
run-name: ${{ github.actor }} is running Back End Test Cases Develop | |
on: | |
push: | |
branches: [main] | |
jobs: | |
Back-End-Tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout GitCode | |
uses: actions/checkout@v4 | |
- name: create env file server | |
run: | | |
cd ./server | |
touch .env | |
echo MONGODB_URI='${{ secrets.MONGODB_URI }}' >> .env | |
echo PORT=${{ secrets.PORT }} >> .env | |
echo CLIENT_URL=${{ secrets.CLIENT_URL }} >> .env | |
echo JWT_SECRET=${{ secrets.JWT_SECRET }} >> .env | |
echo CLIENT_ID=${{ secrets.CLIENT_ID }} >> .env | |
echo CLIENT_SECRET=${{ secrets.CLIENT_SECRET }} >> .env | |
echo REFRESH_TOKEN=${{ secrets.REFRESH_TOKEN }} >> .env | |
- name: create env file client | |
run: | | |
cd ./client | |
touch .env | |
echo REACT_APP_SERVER_URL=${{ secrets.REACT_APP_SERVER_URL }} >> .env | |
echo JWT_SECRET=${{secrets.JWT_SECRET}} >> .env | |
- name: Run Tests | |
run: | | |
cd ./server | |
npm ci | |
npm test | |
deploy: | |
name: Deploy | |
needs: [Back-End-Tests] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to production | |
uses: johnbeynon/render-deploy-action@v0.0.8 | |
with: | |
service-id: ${{ secrets.SERVICE_ID_SERVER }} # Can be found as part of the Deploy Hook | |
api-key: ${{ secrets.RENDER_API_KEY }} # Create your API key in Render Dashboard > Account Settings | |