Backend CD #19
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: Backend CD | |
on: | |
workflow_run: | |
workflows: ["Backend CI"] | |
types: | |
- completed | |
jobs: | |
build: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull Docker image | |
run: docker compose pull | |
- name: Start Containers | |
env: | |
ENVIRONMENT: ${{ secrets.ENVIRONMENT }} | |
DB_NAME: ${{ secrets.DB_NAME}} | |
DB_USER: ${{ secrets.DB_USER}} | |
DB_HOST: ${{ secrets.DB_HOST}} | |
DB_PORT: ${{ secrets.DB_PORT}} | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD}} | |
PORT: ${{ secrets.PORT}} | |
KEY: ${{ secrets.KEY}} | |
SECTRET: ${{ secrets.SECTRET}} | |
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY}} | |
run: docker compose up --force-recreate --detach | |
- name: Cleanup unused Docker images | |
run: docker image prune -f |