cicd trigger run on on DB changes, too #46
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: CI/CD | |
on: | |
push: | |
paths: | |
- "infrastructure/**" | |
- "data/**" | |
- "db/**" | |
- "c3nav.docker-compose.yml" | |
- ".github/workflows/cicd.yml" | |
env: | |
C3NAV_DOCKER_TAG: 60de7857d6f1647503ea5ca84b117ebd8d0aeac1 | |
jobs: | |
deploy-test: | |
runs-on: ubuntu-22.04 | |
if: github.ref == 'refs/heads/main' | |
concurrency: | |
group: deploy-test | |
cancel-in-progress: true | |
env: | |
PROJECT_NAME: c3nav-test | |
COMPOSE_PROJECT_NAME: c3nav-test | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Create .env file | |
uses: noi-techpark/github-actions/env-file@v2 | |
env: | |
X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} | |
X_C3NAV_TAG: ${{ env.C3NAV_DOCKER_TAG }} | |
X_C3NAV_DOMAIN: maps.sfscon.testingmachine.eu | |
X_SERVER_PORT: 1001 | |
- name: Deploy application | |
uses: noi-techpark/github-actions/docker-deploy@v2 | |
with: | |
hosts: 'maps.sfscon.it' | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
docker-username: 'noi-techpark-bot' | |
docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
project-name: ${{ env.PROJECT_NAME }} | |
deploy-prod: | |
runs-on: ubuntu-22.04 | |
if: github.ref == 'refs/heads/prod' | |
concurrency: | |
group: deploy-prod | |
cancel-in-progress: true | |
env: | |
PROJECT_NAME: c3nav-prod | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Create .env file | |
uses: noi-techpark/github-actions/env-file@v2 | |
env: | |
X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} | |
X_C3NAV_TAG: ${{ env.C3NAV_DOCKER_TAG }} | |
X_C3NAV_DOMAIN: maps.sfscon.it | |
X_SERVER_PORT: 1002 | |
- name: Deploy application | |
uses: noi-techpark/github-actions/docker-deploy@v2 | |
with: | |
hosts: 'maps.sfscon.it' | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
docker-username: 'noi-techpark-bot' | |
docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
project-name: ${{ env.PROJECT_NAME }} |