Files
relay/.github/workflows/test-and-deploy.yaml
2026-03-10 13:23:23 +01:00

53 lines
1.5 KiB
YAML

name: deploy on allocated VPS and run tests
on:
push:
branches:
- main
pull_request:
paths-ignore:
- 'scripts/**'
- '**/README.md'
- 'CHANGELOG.md'
- 'LICENSE'
jobs:
allocate:
uses: chatmail/hetzner-relay/.github/workflows/allocate.yml@main
deploy-and-test:
name: deploy on allocated VPS, and run tests
runs-on: ubuntu-latest
needs: allocate
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: prepare SSH
run: |
mkdir ~/.ssh
echo "${{ secrets.STAGING_SSH_KEY }}" >> ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
- name: add hpk42 key to staging server
run: ssh root@${{ secrets.STAGING_SSH_KEY }} 'curl -s https://github.com/hpk42.keys >> .ssh/authorized_keys'
- name: run deploy-chatmail offline tests
run: pytest --pyargs cmdeploy
- run: |
cmdeploy init ${{ secrets.STAGING_SSH_KEY }}
sed -i 's/#\s*mtail_address/mtail_address/' chatmail.ini
- run: |
git clone https://github.com/chatmail/hetzner-relay ../hetzner-relay
pip install ../hetzner-relay
python3 ../hetzner-relay/main.py --dns --test --vps ${{ needs.allocate.outputs.vps_name }} --run-id $GITHUB_RUN_ID --domain2 chatmail-ci.testrun.org .
rebuild:
needs: [allocate, deploy-and-test]
uses: chatmail/hetzner-relay/.github/workflows/rebuild.yml@main
if: always()
with:
vps_name: ${{ needs.allocate.outputs.vps_name }}