Update deploy.yml #494
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: Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- proof-of-concept | |
concurrency: | |
group: test-local-${{ github.ref }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
password: ${{ secrets.SSH_PASSWORD }} | |
port: ${{ secrets.SSH_PORT }} | |
script: | | |
cd /root/ds-etna | |
git pull | |
docker compose pull | |
docker compose up -d | |
docker compose up -d --build --force-recreate nginx | |
cleanup: | |
runs-on: ubuntu-latest | |
needs: | |
- deploy | |
steps: | |
- uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
password: ${{ secrets.SSH_PASSWORD }} | |
port: ${{ secrets.SSH_PORT }} | |
script: if df -hP -k /dev/sda1 | awk '{if ($5+0>=80) exit 1}'; then echo "Space OK"; else docker system prune --force --all --volumes; fi | |
tests: | |
runs-on: ubuntu-latest | |
needs: | |
- deploy | |
env: | |
GH_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run tests | |
run: gh workflow run manual.yml --repo nationalarchives/ds-tna-website-tests --raw-field domain=https://develop.tna.dblclk.dev --raw-field notify-slack=true |