CD #8
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: CD | |
on: | |
workflow_run: | |
workflows: ["CI"] | |
branches: ["main"] | |
types: | |
- completed | |
jobs: | |
deploy: | |
name: deploy | |
runs-on: self-hosted | |
if: ${{ | |
github.event.workflow_run.conclusion == 'success' | |
&& github.event.workflow_run.event == 'push' | |
}} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Create .env file | |
run: | | |
echo "NOCODB_API_TOKEN=${{ secrets.NOCODB_API_TOKEN }}" >> .env | |
echo "NOCODB_API_URL=${{ secrets.NOCODB_API_URL }}" >> .env | |
- name: Deploy docker-compose stack | |
run: docker compose up -d --build --force-recreate | |
- name: Prune Docker system | |
run: docker system prune -af |