ci: use debian-based job images so act_runner can inject node (#8)
This commit is contained in:
@@ -8,6 +8,9 @@ name: build
|
|||||||
# daemon keeps that contract and means a knox change needs no registry
|
# daemon keeps that contract and means a knox change needs no registry
|
||||||
# credentials at all.
|
# credentials at all.
|
||||||
#
|
#
|
||||||
|
# Images are Debian-based on purpose: act_runner injects a glibc Node into the
|
||||||
|
# job container to run JS actions (actions/checkout), which fails on musl.
|
||||||
|
#
|
||||||
# Deployment stays with tf-net: this workflow only makes the new image available
|
# Deployment stays with tf-net: this workflow only makes the new image available
|
||||||
# and restarts the stack when the app is already installed.
|
# and restarts the stack when the app is already installed.
|
||||||
|
|
||||||
@@ -30,7 +33,7 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: golang:1.27-alpine
|
image: golang:1.27
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: go vet ./... && go test ./...
|
- run: go vet ./... && go test ./...
|
||||||
@@ -39,7 +42,7 @@ jobs:
|
|||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: docker:27-cli
|
image: golang:1.27
|
||||||
# Whitelisted in the runner config (valid_volumes): the host daemon and
|
# Whitelisted in the runner config (valid_volumes): the host daemon and
|
||||||
# the CasaOS app directory where compose files live.
|
# the CasaOS app directory where compose files live.
|
||||||
volumes:
|
volumes:
|
||||||
@@ -50,9 +53,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install docker CLI
|
||||||
|
run: |
|
||||||
|
apt-get update -qq
|
||||||
|
apt-get install -y -qq --no-install-recommends docker.io >/dev/null
|
||||||
|
docker version --format '{{.Server.Version}}'
|
||||||
|
|
||||||
- name: Build image on the host daemon
|
- name: Build image on the host daemon
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
git config --global --add safe.directory "$GITHUB_WORKSPACE" || true
|
||||||
# .git is present in the checkout, so the binary records the commit
|
# .git is present in the checkout, so the binary records the commit
|
||||||
# it was built from (`knox --version`).
|
# it was built from (`knox --version`).
|
||||||
docker build \
|
docker build \
|
||||||
@@ -69,10 +79,6 @@ jobs:
|
|||||||
echo "apps/knox is not installed yet; image built, skipping restart"
|
echo "apps/knox is not installed yet; image built, skipping restart"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if ! docker compose version >/dev/null 2>&1; then
|
|
||||||
echo "compose plugin unavailable in this image; restart deferred to tf-net"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
cd /apps/knox
|
cd /apps/knox
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
docker compose ps
|
docker compose ps
|
||||||
|
|||||||
Reference in New Issue
Block a user