-
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.
CI: deploy on staging.testrun.org and if it works, on nine.testrun.org
- Loading branch information
Showing
1 changed file
with
56 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,56 @@ | ||
name: deploy on staging.testrun.org, and if that works, on nine.testrun.org | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- staging-ci | ||
|
||
jobs: | ||
deploy: | ||
name: deploy on staging.testrun.org, and if that works, on nine.testrun.org | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: initenv | ||
run: scripts/initenv.sh | ||
|
||
- name: append venv/bin to PATH | ||
run: echo venv/bin >>$GITHUB_PATH | ||
|
||
- name: run formatting checks | ||
run: cmdeploy fmt -v | ||
|
||
- name: run deploy-chatmail offline tests | ||
run: pytest --pyargs cmdeploy | ||
|
||
- name: rebuild staging.testrun.org to have a clean VPS | ||
run: | | ||
curl -X POST \ | ||
-H "Authorization: Bearer ${{ secrets.HETZNER_API_TOKEN }}" \ | ||
-H "Content-Type: application/json" \ | ||
-d '{"image":"debian12"}' \ | ||
"https://api.hetzner.cloud/v1/servers/${{ secrets.STAGING_SERVER_ID }}/actions/rebuild" | ||
- name: store private SSH key in file | ||
run: mkdir ~/.ssh && echo "${{ secrets.STAGING_SSH_KEY }}" >> ~/.ssh/id_ed25519 | ||
|
||
- name: cmdeploy init staging.testrun.org | ||
run: cmdeploy init staging.testrun.org | ||
|
||
- name: cmdeploy run | ||
run: cmdeploy run | ||
|
||
- name: cmdeploy test | ||
run: cmdeploy test | ||
|
||
- name: cmdeploy init nine.testrun.org | ||
run: rm chatmail.ini && cmdeploy init nine.testrun.org | ||
|
||
- name: cmdeploy run | ||
run: cmdeploy run | ||
|
||
- name: cmdeploy test | ||
run: cmdeploy test | ||
|