Skip to content

Commit

Permalink
update cicd flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-im committed Aug 7, 2023
1 parent 56ed269 commit 28b42fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
# - 5432:5432
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

deploy:
publish:
name: Deploy to Render
needs: testing
runs-on: ubuntu-latest
Expand All @@ -73,19 +73,12 @@ jobs:

- name: Push Docker image to Docker Hub
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/logger:latest

deploy:
runs-on: ubuntu-latest
needs: [testing, publish]
steps:
- name: Deploy to Render
run: |
curl -XPOST "https://api.render.com/v1/services" \
-H "Authorization: Bearer ${{ secrets.RENDER_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{
"name": "logger",
"type": "docker",
"env": ["NODE_ENV=production"],
"dockerOptions": {
"image": "${{ secrets.DOCKERHUB_USERNAME }}/logger:latest"
},
"plan": "free",
"automaticDeploy": true
}'
uses: johnbeynon/[email protected]
with:
service-id: ${{ secrets.SERVICE_ID }}
api-key: ${{ secrets.RENDER_API_KEY }}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ COPY ./server/package*.json ./

RUN npm install --production

RUN npx prisma generate

EXPOSE 5000

# Start the server
Expand Down

0 comments on commit 28b42fc

Please sign in to comment.