Split scraper queue into separate HTTP and browser panels #13
This file contains hidden or 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: Deploy Crawler (Browser Worker) | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'apps/crawler/**' | |
| - '.github/workflows/deploy-crawler-browser.yml' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Read VERSION | |
| id: version | |
| run: echo "version=$(cat apps/crawler/VERSION | tr -d '[:space:]')" >> "$GITHUB_OUTPUT" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: apps/crawler | |
| platforms: linux/amd64 | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/jobseek-crawler:latest | |
| ghcr.io/${{ github.repository_owner }}/jobseek-crawler:v${{ steps.version.outputs.version }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Deploy via SSH | |
| uses: appleboy/ssh-action@v1 | |
| with: | |
| host: ${{ secrets.HETZNER_HOST }} | |
| username: deploy | |
| key: ${{ secrets.HETZNER_SSH_KEY }} | |
| script: | | |
| docker pull ghcr.io/${{ github.repository_owner }}/jobseek-crawler:latest | |
| docker stop jobseek-crawler 2>/dev/null || true | |
| docker rm jobseek-crawler 2>/dev/null || true | |
| docker run -d \ | |
| --name jobseek-crawler \ | |
| --restart unless-stopped \ | |
| --env-file /home/deploy/crawler.env \ | |
| --network host \ | |
| --memory=3g \ | |
| --shm-size=1g \ | |
| ghcr.io/${{ github.repository_owner }}/jobseek-crawler:latest \ | |
| uv run --no-sync scheduler | |
| docker image prune -f |