build & deploy: poller #53
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
name: 'build & deploy: poller' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'Thaliak.Common.Database/**' | |
- 'Thaliak.Service.Poller/**' | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Thaliak.Service.Poller/Dockerfile | |
push: true | |
tags: ghcr.io/crystallinetools/thaliak-poller:latest | |
- name: Set up WireGuard | |
uses: egor-tensin/[email protected] | |
with: | |
endpoint: '${{ secrets.WG_ENDPOINT }}' | |
endpoint_public_key: '${{ secrets.WG_ENDPOINT_PUBKEY }}' | |
ips: '${{ secrets.WG_ADDRESS }}' | |
allowed_ips: '${{ secrets.WG_ALLOWED_IPS }}' | |
private_key: '${{ secrets.WG_PRIVKEY }}' | |
preshared_key: '${{ secrets.WG_SHAREDKEY }}' | |
- name: Deploy to production server | |
uses: appleboy/[email protected] | |
with: | |
host: '${{ secrets.REMOTE_HOST }}' | |
port: 22 | |
username: '${{ secrets.REMOTE_USER }}' | |
key: '${{ secrets.REMOTE_SSH_KEY }}' | |
script: deploy poller |