-
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 #1059 from dm3-org/addVariableForPersistenceDirectory
Add variable for persistence directory
- Loading branch information
Showing
3 changed files
with
36 additions
and
5 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
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,23 @@ | ||
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 ${{ vars.PERSISTENCE_DIRECTORY }}/db && rm -r * || true; \ | ||
cd ${{ vars.PERSISTENCE_DIRECTORY }}/storage && 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" |
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