Skip to content

Commit

Permalink
ci: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov committed Jan 19, 2025
1 parent cfad2c1 commit de13453
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/go-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Go check

on: push
on:
push:
branches:
- '**'
tags-ignore:
- '**'

jobs:
changes:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/[email protected]

- uses: docker/setup-buildx-action@v3
- uses: docker/setup-buildx-action@v3 # for cross-arch build - GH runners are AMD but VPS is ARM

- name: Set release version
# `#v` to strip the `v` prefix: v1.2.3 -> 1.2.3
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/shell-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Shell check

on: push
on:
push:
branches:
- '**'
tags-ignore:
- '**'

jobs:
checks:
Expand Down
27 changes: 16 additions & 11 deletions docs/03-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,27 @@ git status
2. Create a tag (following semver) and push it to remote:

```sh
git tag v1.2.3
git push origin v1.2.3
git tag v1.0.4
git push origin v1.0.4
```

This tag push triggers the [`release` workflow](https://github.com/ivov/n8n-shortlink/actions/workflows/release.yml). On completion, the new image is [listed](https://github.com/ivov/n8n-shortlink/pkgs/container/n8n-shortlink) on GHCR. Watchtower will discover the image and deploy it to production.
This tag push triggers the [`release` workflow](https://github.com/ivov/n8n-shortlink/actions/workflows/release.yml) to build an ARM64 Docker image. The new image will be [listed](https://github.com/ivov/n8n-shortlink/pkgs/container/n8n-shortlink) on GHCR.

Watchtower polls every six hours. To prompt Watchtower to check immediately:
Watchtower polls for new versions of this image every six hours. On discovering a new version of this image, Watchtower will update the container to the new image version.

To prompt Watchtower to check immediately:

```sh
ssh n8n-shortlink-infra "docker kill --signal=SIGHUP watchtower"
# on a terminal
ssh n8n-shortlink-infra
docker logs -f watchtower

# on another terminal
ssh n8n-shortlink-infra
docker exec watchtower /watchtower --run-once n8n-shortlink
```

Then wait for Watchtower to pull the new image and start the container, and watch for the new version being deployed:
## TODOs

```sh
# on separate terminals
ssh n8n-shortlink-infra "docker logs -f n8n-shortlink"
ssh n8n-shortlink-infra "docker logs -f watchtower"
```
- [] Surface version via `/healthz`
- [] Remove `unknown/unknown` from published image

0 comments on commit de13453

Please sign in to comment.