aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-03-11 22:27:43 +0500
committerEgor Tensin <Egor.Tensin@gmail.com>2022-03-11 22:31:16 +0500
commit6e684cf40e93088131fa1008de52e9f7d33b0127 (patch)
tree07ba2743581a31ffa9cc49bfadf1371407d4f384 /.github/workflows
parentDockerfile: remove tini (diff)
downloadvoid-6e684cf40e93088131fa1008de52e9f7d33b0127.tar.gz
void-6e684cf40e93088131fa1008de52e9f7d33b0127.zip
workflows/ci: add a deploy job
Diffstat (limited to '')
-rw-r--r--.github/workflows/ci.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f0e1d49..21027df 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -21,3 +21,28 @@ jobs:
python-version: '${{ matrix.python-version }}'
- name: Run tests
run: ./test/test.sh
+
+ deploy:
+ needs: [test]
+ runs-on: ubuntu-latest
+ name: Deploy
+ if: github.ref == 'refs/heads/master'
+ env:
+ DOCKER_HOST: 'tcp://${{ secrets.DEPLOY_DOCKER_HOST }}:${{ secrets.DEPLOY_DOCKER_PORT }}'
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Set up VPN
+ uses: egor-tensin/setup-wireguard@v1
+ with:
+ endpoint: '${{ secrets.WG_ENDPOINT }}'
+ endpoint_public_key: '${{ secrets.WG_ENDPOINT_PUBLIC_KEY }}'
+ ips: '${{ secrets.WG_IPS }}'
+ allowed_ips: '${{ secrets.WG_ALLOWED_IPS }}'
+ private_key: '${{ secrets.WG_PRIVATE_KEY }}'
+ preshared_key: '${{ secrets.WG_PRESHARED_KEY }}'
+ - name: Deploy
+ run: |
+ docker-compose pull
+ docker-compose build --pull
+ docker-compose up -d