-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1058 from dm3-org/feature/resetStagingState
add action that resets the state of staging
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: deploy | ||
on: workflow_dispatch | ||
|
||
jobs: | ||
reset-staging-state: | ||
environment: 'staging' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Stop docker on server | ||
run: | | ||
ssh -i ./ssh-key app@${{ vars.HOST_DOMAIN }} "\ | ||
cd dm3 && docker compose down" | ||
ssh -i ./ssh-key root@${{ vars.HOST_DOMAIN }} "\ | ||
systemctl restart docker.service" | ||
- name: Reset state of staging environment | ||
run: | | ||
ssh -i ./ssh-key root@${{ vars.HOST_DOMAIN }} "\ | ||
cd /mnt/dm3_prod_volume/db && rm -r * || true" | ||
- name: Start docker on server | ||
run: | | ||
ssh -i ./ssh-key app@${{ vars.HOST_DOMAIN }} "\ | ||
cd dm3 && docker compose --env-file .env up -d && docker system prune -af" |