Skip to content

CI

CI #6

Workflow file for this run

name: CD
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: docker build -t shemafred24/blog-api-devops .
- name: Log in to Docker Hub
run: echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
- name: Push Docker image
run: docker push shemafred24/blog-api-devops
- name: Deploy to Render
env:
RENDER_API_KEY: ${{ secrets.RENDER_API_KEY }}
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.RENDER_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"serviceId": "srv-cqjrst0gph6c739da4q0"}' \
https://api.render.com/v1/services/srv-cqjrst0gph6c739da4q0/deploys