mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 04:48:06 +00:00
re-enable running the CI in pull requests, but not concurrently
This commit is contained in:
43
.github/workflows/test-and-deploy.yaml
vendored
43
.github/workflows/test-and-deploy.yaml
vendored
@@ -4,12 +4,17 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- staging-ci
|
pull-request:
|
||||||
|
paths-ignore:
|
||||||
|
- 'scripts/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
name: deploy on staging.testrun.org, and run tests
|
name: deploy on staging.testrun.org, and run tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
concurrency:
|
||||||
|
group: staging-deploy
|
||||||
|
cancel-in-progress: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
@@ -19,16 +24,16 @@ jobs:
|
|||||||
echo "${{ secrets.STAGING_SSH_KEY }}" >> ~/.ssh/id_ed25519
|
echo "${{ secrets.STAGING_SSH_KEY }}" >> ~/.ssh/id_ed25519
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
ssh-keyscan staging.testrun.org > ~/.ssh/known_hosts
|
ssh-keyscan staging.testrun.org > ~/.ssh/known_hosts
|
||||||
# rsync -avz root@staging.testrun.org:/var/lib/acme . || true
|
rsync -avz root@staging.testrun.org:/var/lib/acme . || true
|
||||||
# rsync -avz root@staging.testrun.org:/var/lib/rspamd/dkim . || true
|
rsync -avz root@staging.testrun.org:/etc/dkimkeys . || true
|
||||||
|
|
||||||
#- name: rebuild staging.testrun.org to have a clean VPS
|
- name: rebuild staging.testrun.org to have a clean VPS
|
||||||
# run: |
|
run: |
|
||||||
# curl -X POST \
|
curl -X POST \
|
||||||
# -H "Authorization: Bearer ${{ secrets.HETZNER_API_TOKEN }}" \
|
-H "Authorization: Bearer ${{ secrets.HETZNER_API_TOKEN }}" \
|
||||||
# -H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
# -d '{"image":"debian-12"}' \
|
-d '{"image":"debian-12"}' \
|
||||||
# "https://api.hetzner.cloud/v1/servers/${{ secrets.STAGING_SERVER_ID }}/actions/rebuild"
|
"https://api.hetzner.cloud/v1/servers/${{ secrets.STAGING_SERVER_ID }}/actions/rebuild"
|
||||||
|
|
||||||
- run: scripts/initenv.sh
|
- run: scripts/initenv.sh
|
||||||
|
|
||||||
@@ -41,14 +46,14 @@ jobs:
|
|||||||
- name: run deploy-chatmail offline tests
|
- name: run deploy-chatmail offline tests
|
||||||
run: pytest --pyargs cmdeploy
|
run: pytest --pyargs cmdeploy
|
||||||
|
|
||||||
#- name: upload TLS cert after rebuilding
|
- name: upload TLS cert after rebuilding
|
||||||
# run: |
|
run: |
|
||||||
# echo " --- wait until staging.testrun.org VPS is rebuilt --- "
|
echo " --- wait until staging.testrun.org VPS is rebuilt --- "
|
||||||
# rm ~/.ssh/known_hosts
|
rm ~/.ssh/known_hosts
|
||||||
# while ! ssh -o ConnectTimeout=180 -o StrictHostKeyChecking=accept-new -v root@staging.testrun.org id -u ; do sleep 1 ; done
|
while ! ssh -o ConnectTimeout=180 -o StrictHostKeyChecking=accept-new -v root@staging.testrun.org id -u ; do sleep 1 ; done
|
||||||
# ssh -o StrictHostKeyChecking=accept-new -v root@staging.testrun.org id -u
|
ssh -o StrictHostKeyChecking=accept-new -v root@staging.testrun.org id -u
|
||||||
# rsync -avz acme root@staging.testrun.org:/var/lib/ || true
|
rsync -avz acme root@staging.testrun.org:/var/lib/ || true
|
||||||
# rsync -avz dkim root@staging.testrun.org:/var/lib/rspamd/ || true
|
rsync -avz dkimkeys root@staging.testrun.org:/etc/ || true
|
||||||
|
|
||||||
- run: cmdeploy init staging.testrun.org
|
- run: cmdeploy init staging.testrun.org
|
||||||
|
|
||||||
@@ -56,7 +61,7 @@ jobs:
|
|||||||
|
|
||||||
- name: set DNS entries
|
- name: set DNS entries
|
||||||
run: |
|
run: |
|
||||||
#ssh -o StrictHostKeyChecking=accept-new -v root@staging.testrun.org chown _rspamd:_rspamd -R /var/lib/rspamd/dkim
|
ssh -o StrictHostKeyChecking=accept-new -v root@staging.testrun.org chown opendkim:opendkim -R /etc/dkimkeys
|
||||||
cmdeploy dns --zonefile staging-generated.zone
|
cmdeploy dns --zonefile staging-generated.zone
|
||||||
cat staging-generated.zone >> .github/workflows/staging.testrun.org-default.zone
|
cat staging-generated.zone >> .github/workflows/staging.testrun.org-default.zone
|
||||||
cat .github/workflows/staging.testrun.org-default.zone
|
cat .github/workflows/staging.testrun.org-default.zone
|
||||||
|
|||||||
Reference in New Issue
Block a user