38 lines
1.3 KiB
YAML
38 lines
1.3 KiB
YAML
name: Deploy scraper-google
|
|
|
|
# Forgejo Actions (git.altricade.com). Workflow files live in .forgejo/workflows/.
|
|
# Mirrors the old .gitlab-ci.yml deploy: build/test the Go code, then SSH + rsync
|
|
# to the server and `docker compose up -d --build` for scraper-google.
|
|
on:
|
|
push:
|
|
workflow_dispatch: {} # manual "deploy" button, matching the GitLab `when: manual` gate
|
|
|
|
jobs:
|
|
build:
|
|
# Use the Node-based image so JS actions (checkout, setup-go) can run — the `go`
|
|
# image has no Node, which breaks actions/checkout with:
|
|
# exec: "node": executable file not found in $PATH
|
|
# setup-go then installs the exact Go the go.work needs.
|
|
runs-on: docker # node:22-bookworm
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
- run: go version
|
|
- run: go build ./...
|
|
- run: go test ./...
|
|
|
|
deploy:
|
|
needs: build
|
|
runs-on: docker # node:22-bookworm — the runner has the host Docker socket mounted
|
|
# Deploy on any push to master, and also when triggered manually from master.
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
environment:
|
|
name: production
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build & start scraper-google
|
|
working-directory: services/scraper-google
|
|
run: docker compose up -d --build
|