ci: update source path
This commit is contained in:
@@ -51,7 +51,7 @@ jobs:
|
|||||||
|
|
||||||
# ── 2. Deploy ─────────────────────────────────────────────────────────────────
|
# ── 2. Deploy ─────────────────────────────────────────────────────────────────
|
||||||
deploy:
|
deploy:
|
||||||
name: Rolling deploy
|
name: Deploy
|
||||||
runs-on: stage-gatehouse-api
|
runs-on: stage-gatehouse-api
|
||||||
needs: build
|
needs: build
|
||||||
env:
|
env:
|
||||||
@@ -60,10 +60,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Deploy (rolling restart)
|
- name: Deploy (docker compose up)
|
||||||
run: |
|
run: |
|
||||||
cp docker-compose.yml "${COMPOSE_DIR}/docker-compose.yml"
|
cp docker-compose.yml "${COMPOSE_DIR}/docker-compose.yml"
|
||||||
bash deploy/deploy.sh "${{ needs.build.outputs.tag }}"
|
cd "${COMPOSE_DIR}"
|
||||||
|
IMAGE_TAG="${{ needs.build.outputs.tag }}" docker compose up -d --remove-orphans
|
||||||
|
|
||||||
# ── 3. Alert ──────────────────────────────────────────────────────────────────
|
# ── 3. Alert ──────────────────────────────────────────────────────────────────
|
||||||
alert:
|
alert:
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
|
|
||||||
# ── 2. Deploy ─────────────────────────────────────────────────────────────────
|
# ── 2. Deploy ─────────────────────────────────────────────────────────────────
|
||||||
deploy:
|
deploy:
|
||||||
name: Rolling deploy
|
name: Deploy
|
||||||
runs-on: prod-gatehouse-api
|
runs-on: prod-gatehouse-api
|
||||||
needs: build
|
needs: build
|
||||||
env:
|
env:
|
||||||
@@ -59,10 +59,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Deploy (rolling restart)
|
- name: Deploy (docker compose up)
|
||||||
run: |
|
run: |
|
||||||
cp docker-compose.yml "${COMPOSE_DIR}/docker-compose.yml"
|
cp docker-compose.yml "${COMPOSE_DIR}/docker-compose.yml"
|
||||||
bash deploy/deploy.sh "${{ needs.build.outputs.tag }}"
|
cd "${COMPOSE_DIR}"
|
||||||
|
IMAGE_TAG="${{ needs.build.outputs.tag }}" docker compose up -d --remove-orphans
|
||||||
|
|
||||||
# ── 3. Alert ──────────────────────────────────────────────────────────────────
|
# ── 3. Alert ──────────────────────────────────────────────────────────────────
|
||||||
alert:
|
alert:
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ node_major_version: "26"
|
|||||||
trivy_version: "0.71.2"
|
trivy_version: "0.71.2"
|
||||||
gitleaks_version: "8.30.1"
|
gitleaks_version: "8.30.1"
|
||||||
|
|
||||||
|
# Docker CLI plugins. The engine ships without them, so `docker compose` (used by
|
||||||
|
# deploy.sh) and `docker buildx` are missing — deploy.sh then fails with exit 125.
|
||||||
|
# Installed as pinned binaries into the host cli-plugins dir; bump to upgrade.
|
||||||
|
docker_compose_version: "5.1.4"
|
||||||
|
docker_buildx_version: "0.35.0"
|
||||||
|
|
||||||
# Registration tokens come from env vars named by each project's `token_env`
|
# Registration tokens come from env vars named by each project's `token_env`
|
||||||
# (e.g. RUNNER_TOKEN_GATEHOUSE_API). Export them on the control node before running.
|
# (e.g. RUNNER_TOKEN_GATEHOUSE_API). Export them on the control node before running.
|
||||||
# Mint from: Gitea repo → Settings → Actions → Runners → Create new runner token.
|
# Mint from: Gitea repo → Settings → Actions → Runners → Create new runner token.
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ runners:
|
|||||||
|
|
||||||
- project: gatehouse-ui
|
- project: gatehouse-ui
|
||||||
url: https://source.hawkless.id.au/coryHawkvelt/gatehouse-ui
|
url: https://source.hawkless.id.au/coryHawkvelt/gatehouse-ui
|
||||||
labels: "self-hosted:host,linux:host,stage:host"
|
labels: "self-hosted:host,linux:host,stage:host,stage-gatehouse-ui:host"
|
||||||
token_env: RUNNER_TOKEN_GATEHOUSE_UI
|
token_env: RUNNER_TOKEN_GATEHOUSE_UI
|
||||||
count: 1
|
count: 1
|
||||||
|
|||||||
@@ -84,6 +84,43 @@
|
|||||||
mode: "0755"
|
mode: "0755"
|
||||||
when: gitleaks_version not in (gitleaks_check.stdout | default(''))
|
when: gitleaks_version not in (gitleaks_check.stdout | default(''))
|
||||||
|
|
||||||
|
# The Docker engine ships without CLI plugins, so `docker compose` (used by
|
||||||
|
# deploy.sh) and `docker buildx` are absent. Install them host-wide; this
|
||||||
|
# path is searched by both docker.io and docker-ce CLIs.
|
||||||
|
- name: Ensure Docker CLI plugins dir exists
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /usr/libexec/docker/cli-plugins
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Check installed Docker Compose plugin version
|
||||||
|
ansible.builtin.command: docker compose version --short
|
||||||
|
register: compose_check
|
||||||
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
|
- name: Install Docker Compose v2 plugin {{ docker_compose_version }}
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
url: "https://github.com/docker/compose/releases/download/v{{ docker_compose_version }}/docker-compose-linux-x86_64"
|
||||||
|
dest: /usr/libexec/docker/cli-plugins/docker-compose
|
||||||
|
mode: "0755"
|
||||||
|
force: true
|
||||||
|
when: docker_compose_version not in (compose_check.stdout | default(''))
|
||||||
|
|
||||||
|
- name: Check installed Docker Buildx plugin version
|
||||||
|
ansible.builtin.command: docker buildx version
|
||||||
|
register: buildx_check
|
||||||
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
|
- name: Install Docker Buildx plugin {{ docker_buildx_version }}
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
url: "https://github.com/docker/buildx/releases/download/v{{ docker_buildx_version }}/buildx-v{{ docker_buildx_version }}.linux-amd64"
|
||||||
|
dest: /usr/libexec/docker/cli-plugins/docker-buildx
|
||||||
|
mode: "0755"
|
||||||
|
force: true
|
||||||
|
when: docker_buildx_version not in (buildx_check.stdout | default(''))
|
||||||
|
|
||||||
# Deploy target for each project's compose stack. Owned by the runner so the
|
# Deploy target for each project's compose stack. Owned by the runner so the
|
||||||
# deploy job can `cp docker-compose.yml` here; the host-managed .env lives
|
# deploy job can `cp docker-compose.yml` here; the host-managed .env lives
|
||||||
# here too. Basename matches the compose project name, preserving volumes.
|
# here too. Basename matches the compose project name, preserving volumes.
|
||||||
|
|||||||
Reference in New Issue
Block a user