45 lines
1.8 KiB
YAML
45 lines
1.8 KiB
YAML
# Builds and pushes the archied and archie-agent images on every merge
|
|
# to main. carina's watchtower container (see docker-compose.yml) picks
|
|
# up the new images and restarts the running daemons -- this workflow
|
|
# never touches carina directly.
|
|
name: deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["archied/v*", "archie/v*"]
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Log in to registry
|
|
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u sam --password-stdin
|
|
|
|
- name: Build and push archied
|
|
run: |
|
|
GATEWAY_TAG="$(git tag --points-at HEAD --list 'archied/v*' | sort -V | tail -1)"
|
|
RUNTIME_TAG="$(git tag --points-at HEAD --list 'archie/v*' | sort -V | tail -1)"
|
|
GATEWAY_VERSION="${GATEWAY_TAG#archied/}"
|
|
RUNTIME_VERSION="${RUNTIME_TAG#archie/}"
|
|
[ -n "$GATEWAY_VERSION" ] || GATEWAY_VERSION=dev
|
|
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION=dev
|
|
docker build \
|
|
--build-arg GATEWAY_VERSION="$GATEWAY_VERSION" \
|
|
--build-arg RUNTIME_VERSION="$RUNTIME_VERSION" \
|
|
-f Dockerfile.archied -t git.catlow.cloud/sam/archied:latest .
|
|
docker push git.catlow.cloud/sam/archied:latest
|
|
|
|
- name: Build and push archie-agent
|
|
run: |
|
|
RUNTIME_TAG="$(git tag --points-at HEAD --list 'archie/v*' | sort -V | tail -1)"
|
|
RUNTIME_VERSION="${RUNTIME_TAG#archie/}"
|
|
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION=dev
|
|
docker build --build-arg RUNTIME_VERSION="$RUNTIME_VERSION" -f Dockerfile -t git.catlow.cloud/sam/archie-agent:latest .
|
|
docker push git.catlow.cloud/sam/archie-agent:latest
|