Skip to content

Merge pull request #30 from thomasoca/add-installer-command #30

Merge pull request #30 from thomasoca/add-installer-command

Merge pull request #30 from thomasoca/add-installer-command #30

name: Deploy to production environment
# Run workflow on every push to main branch.
# This workflow will build docker image with latest tag and push it to container registry
on:
push:
branches: [main]
workflow_dispatch: # So it can be triggered manually if needed
env:
IMAGE_NAME: cv-generator
GHCR_REGISTRY: ghcr.io
GHCR_REPOSITORY: thomasoca
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to GHCR
uses: docker/login-action@v1
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ env.GHCR_REGISTRY }}/${{ env.GHCR_REPOSITORY }}/${{ env.IMAGE_NAME }}:latest
- name: Trigger Render API to start the production deployment
uses: johnbeynon/render-deploy-action@v0.0.8
with:
service-id: ${{ secrets.RENDER_SERVICE_NAME }}
api-key: ${{ secrets.RENDER_API_KEY }}