Compare commits
8
Commits
42871c51cd
...
v0.3.7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
943897044a | ||
|
|
53c8c8e94c | ||
|
|
c4c9f37bbc | ||
|
|
a1c429782f | ||
|
|
0dcc7bbf76 | ||
|
|
77748bcba2 | ||
|
|
994879749b | ||
|
|
41e40c9ab2 |
@@ -0,0 +1,14 @@
|
||||
# CI job image for the Gitea Actions runners.
|
||||
#
|
||||
# JS actions (actions/checkout, docker/build-push-action) execute INSIDE the
|
||||
# job container and need node; builds talk to the runner's daemon through the
|
||||
# mounted /var/run/docker.sock, so this image needs the docker CLI + buildx
|
||||
# but no daemon. Baking them in means jobs never download binaries at runtime:
|
||||
# download.docker.com and github.com releases are unreachable (connection
|
||||
# reset) from the cluster's network.
|
||||
#
|
||||
# Tagged as src.panahifar.ir/ahp/act-job:20 (node 20 / bookworm).
|
||||
FROM node:20-bookworm
|
||||
|
||||
COPY --from=docker:27-cli /usr/local/bin/docker /usr/local/bin/docker
|
||||
COPY --from=docker:27-cli /usr/local/libexec/docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
|
||||
@@ -4,8 +4,9 @@ name: build-and-push
|
||||
# Gitea container registry. Argo CD then rolls them out via
|
||||
# deploy/helm/pargar (values-apollo.yaml pins the matching image tags).
|
||||
#
|
||||
# Requires a registered Gitea Actions runner and `permissions.packages: write`
|
||||
# so the built-in job token (secrets.GITEA_TOKEN) can push to the registry.
|
||||
# Requires a registered Gitea Actions runner, a `REGISTRY_TOKEN` secret
|
||||
# (Gitea access token with write:package scope) so docker login can push to
|
||||
# the registry.
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -20,10 +21,14 @@ env:
|
||||
REGISTRY: src.panahifar.ir
|
||||
BACKEND_IMAGE: ahp/pargar-backend
|
||||
FRONTEND_IMAGE: ahp/pargar-frontend
|
||||
# Single credential location shared by login + build steps (the job runs
|
||||
# in a container whose HOME can differ between steps).
|
||||
DOCKER_CONFIG: /tmp/.docker
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
# Gitea runners match on their registered labels (default: linux-amd64)
|
||||
runs-on: linux-amd64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -31,12 +36,35 @@ jobs:
|
||||
id: meta
|
||||
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Builds run docker-outside-of-docker through the runner-mounted
|
||||
# /var/run/docker.sock. The apollo runner's job image (act-job:20,
|
||||
# .gitea/job-image) already ships the docker CLI + buildx in system
|
||||
# plugin paths; runners on other networks fall back to installing them
|
||||
# at runtime (needs access to download.docker.com + github.com, and the
|
||||
# plugin must land where docker looks with DOCKER_CONFIG set).
|
||||
- name: Set up Docker CLI (preinstalled on apollo; install elsewhere)
|
||||
run: |
|
||||
set -eu
|
||||
if [ ! -S /var/run/docker.sock ]; then
|
||||
echo "::error::/var/run/docker.sock is not mounted in the job container - the act_runner config must mount it (docker_host: \"\" auto-mounts it)."
|
||||
exit 1
|
||||
fi
|
||||
if ! command -v docker >/dev/null 2>&1 || ! docker buildx version >/dev/null 2>&1; then
|
||||
curl -fsSL "https://download.docker.com/linux/static/stable/x86_64/docker-27.5.1.tgz" | tar xz --strip-components=1 -C /usr/local/bin docker/docker
|
||||
mkdir -p /root/.docker/cli-plugins /usr/local/libexec/docker/cli-plugins
|
||||
curl -fsSL "https://github.com/docker/buildx/releases/download/v0.19.3/buildx-v0.19.3.linux-amd64" -o /root/.docker/cli-plugins/docker-buildx
|
||||
cp /root/.docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
|
||||
chmod +x /root/.docker/cli-plugins/docker-buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
|
||||
fi
|
||||
docker version
|
||||
docker buildx version
|
||||
|
||||
- name: Login to Gitea container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITEA_TOKEN }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push backend
|
||||
uses: docker/build-push-action@v6
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
{{- else if and .Values.postgres.auth.password (not (hasPrefix "change-me" .Values.postgres.auth.password)) (ne .Values.postgres.auth.password "") }}
|
||||
{{- $pgPass = .Values.postgres.auth.password }}
|
||||
{{- else }}
|
||||
{{- $pgPass = randAlphaNum 32 }}
|
||||
{{- /* Fail loudly instead of silently minting a random password: under
|
||||
Argo CD (helm template) `lookup` is always empty, and a random
|
||||
value would diverge from the live service on every render. */}}
|
||||
{{- fail "postgres.auth.password must be set: no existing pargar-postgres secret was found and .Values.postgres.auth.password is empty or a change-me placeholder" }}
|
||||
{{- end }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
@@ -30,7 +33,7 @@ stringData:
|
||||
{{- else if and .Values.redis.auth.password (not (hasPrefix "change-me" .Values.redis.auth.password)) (ne .Values.redis.auth.password "") }}
|
||||
{{- $rdPass = .Values.redis.auth.password }}
|
||||
{{- else }}
|
||||
{{- $rdPass = randAlphaNum 32 }}
|
||||
{{- fail "redis.auth.password must be set: no existing pargar-redis secret was found and .Values.redis.auth.password is empty or a change-me placeholder" }}
|
||||
{{- end }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
@@ -56,7 +59,7 @@ stringData:
|
||||
{{- else if and .Values.rustfs.auth.secretKey (not (hasPrefix "change-me" .Values.rustfs.auth.secretKey)) (ne .Values.rustfs.auth.secretKey "") }}
|
||||
{{- $secret = .Values.rustfs.auth.secretKey }}
|
||||
{{- else }}
|
||||
{{- $secret = randAlphaNum 40 }}
|
||||
{{- fail "rustfs.auth.secretKey must be set: no existing pargar-rustfs secret was found and .Values.rustfs.auth.secretKey is empty or a change-me placeholder" }}
|
||||
{{- end }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
|
||||
@@ -11,7 +11,7 @@ backend:
|
||||
image:
|
||||
pullPolicy: IfNotPresent
|
||||
repository: pargar-backend
|
||||
tag: 0.3.5
|
||||
tag: 0.3.7
|
||||
metrics:
|
||||
serviceMonitor:
|
||||
enabled: true
|
||||
@@ -41,7 +41,7 @@ frontend:
|
||||
image:
|
||||
pullPolicy: IfNotPresent
|
||||
repository: pargar-frontend
|
||||
tag: 0.3.5
|
||||
tag: 0.3.7
|
||||
podDisruptionBudget:
|
||||
enabled: false
|
||||
replicaCount: 2
|
||||
@@ -58,7 +58,10 @@ global:
|
||||
# Images published by .gitea/workflows/build-and-push.yaml on tag push.
|
||||
imageRegistry: src.panahifar.ir/ahp
|
||||
publicUrl: https://pargar.panahifar.ir
|
||||
imagePullSecrets: []
|
||||
# Gitea packages are private: kubelet pulls need secret `gitea-pull`
|
||||
# (docker-registry secret for src.panahifar.ir, created in ns pargar).
|
||||
imagePullSecrets:
|
||||
- name: gitea-pull
|
||||
ingress:
|
||||
enabled: true
|
||||
tls:
|
||||
|
||||
Reference in New Issue
Block a user