Fix validation workflows for self-hosted runner
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
name: Deploy to Server
|
||||
run-name: Deploying to ${{ runner.os}} server on ${{ gitea.ref }}
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- ci/gitea-actions
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: prod
|
||||
steps:
|
||||
- name: Fetch and Diff Analysis
|
||||
id: diff
|
||||
run: |
|
||||
cd ${{ secrets.PROD_DIR }}
|
||||
git fetch origin main
|
||||
CHANGES=$(git diff --name-only HEAD origin/main | cut -d/ -f1 | sort -u | tr '\n' ' ')
|
||||
echo "dirs=$CHANGES" >> $GITHUB_OUTPUT
|
||||
echo "Changed dirs: $CHANGES"
|
||||
|
||||
- name: Sync Server Files
|
||||
run: |
|
||||
cd ${{ secrets.PROD_DIR }}
|
||||
git reset --hard origin/main
|
||||
echo "Server files synced with origin/main"
|
||||
|
||||
- name: Deploy Services
|
||||
run: |
|
||||
cd ${{ secrets.PROD_DIR }}
|
||||
for dir in ${{ steps.diff.outputs.dirs }}; do
|
||||
if [ -d "$dir" ] && ([ -f "$dir/compose.yaml" ] || [ -f "$dir/docker-compose.yaml" ]); then
|
||||
echo ">>> Deploying $dir"
|
||||
cd "$dir"
|
||||
DOCKER_BUILDKIT=1 BUILDKIT_PROGRESS=plain docker compose up -d --build --no-color
|
||||
cd ..
|
||||
else
|
||||
echo ">>> Skipping $dir: no compose file found"
|
||||
fi
|
||||
done
|
||||
@@ -14,14 +14,14 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install yamllint
|
||||
run: python -m pip install --disable-pip-version-check --no-cache-dir yamllint
|
||||
|
||||
- name: Lint YAML syntax
|
||||
shell: bash
|
||||
run: |
|
||||
git ls-files -z '*.yml' '*.yaml' \
|
||||
| xargs -0 -r yamllint -c .yamllint
|
||||
docker run --rm \
|
||||
-v "$PWD:/work" \
|
||||
-w /work \
|
||||
cytopia/yamllint:latest \
|
||||
yamllint -c .yamllint .
|
||||
|
||||
k8s:
|
||||
runs-on: [self-hosted, linux, arch, homelab]
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
mapfile -t manifests < <(
|
||||
git ls-files '*k8s/*.yaml' '*k8s/*.yml' \
|
||||
git ls-files ':(glob)**/k8s/**/*.yaml' ':(glob)**/k8s/**/*.yml' \
|
||||
| grep -Ev '(^|/)(kustomization\.ya?ml|.*\.example\.ya?ml|.*values\.ya?ml|patch-.*\.ya?ml)$'
|
||||
)
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install yamllint
|
||||
run: python -m pip install --disable-pip-version-check --no-cache-dir yamllint
|
||||
|
||||
- name: Lint YAML syntax
|
||||
shell: bash
|
||||
run: |
|
||||
git ls-files -z '*.yml' '*.yaml' \
|
||||
| xargs -0 -r yamllint -c .yamllint
|
||||
docker run --rm \
|
||||
-v "$PWD:/work" \
|
||||
-w /work \
|
||||
cytopia/yamllint:latest \
|
||||
yamllint -c .yamllint .
|
||||
|
||||
k8s:
|
||||
runs-on: [self-hosted, linux, arch, homelab]
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
mapfile -t manifests < <(
|
||||
git ls-files '*k8s/*.yaml' '*k8s/*.yml' \
|
||||
git ls-files ':(glob)**/k8s/**/*.yaml' ':(glob)**/k8s/**/*.yml' \
|
||||
| grep -Ev '(^|/)(kustomization\.ya?ml|.*\.example\.ya?ml|.*values\.ya?ml|patch-.*\.ya?ml)$'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user