Skip to content

Production CD

Production CD #98

Workflow file for this run

name: Production CD
on:
workflow_dispatch:
jobs:
deploy:
runs-on: [self-hosted, rpi, prod]
environment: yacs-rpi-prod
env:
HOST: ${{ secrets.HOST }}
ADMIN_PASS: ${{ secrets.ADMIN_PASS }}
DB_PASS: ${{ secrets.DB_PASS }}
AUTO_LE: yes
API_WORKERS: 8
steps:
# - name: Wait for tests to succeed
# uses: lewagon/wait-on-check-action@v1.0.0
# with:
# ref: ${{ github.ref }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# check-name: pytest
# - name: Wait for lighthouse tests to succeed
# uses: lewagon/wait-on-check-action@v1.0.0
# with:
# ref: ${{ github.ref }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# check-name: 'Lighthouse CI'
- uses: actions/checkout@v2
with:
ref: master
- name: Build images
run: |
docker-compose -f docker-compose.yml -f docker-compose.production.yml build yacs_api yacs_web
- name: Update yacs_api
run: |
docker-compose -f docker-compose.yml -f docker-compose.production.yml stop yacs_api &&
docker-compose -f docker-compose.yml -f docker-compose.production.yml rm -f yacs_api &&
docker-compose -f docker-compose.yml -f docker-compose.production.yml up -d yacs_api
- name: Update yacs_web
run: |
docker-compose -f docker-compose.yml -f docker-compose.production.yml stop yacs_web &&
docker-compose -f docker-compose.yml -f docker-compose.production.yml rm -f yacs_web &&
docker-compose -f docker-compose.yml -f docker-compose.production.yml up -d yacs_web