Compare commits

..

2 Commits

Author SHA1 Message Date
a598048fd9 fix: nginx deployment syntax errors
Some checks failed
poll-upstream / check (push) Failing after 1s
2026-04-24 10:34:59 +03:00
4025171c75 fix: package name 2026-04-24 09:53:34 +03:00
2 changed files with 12 additions and 9 deletions

View File

@@ -2,7 +2,7 @@ name: poll-upstream
on: on:
schedule: schedule:
- cron: "*/15 * * * *" - cron: "*/1 * * * *"
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
@@ -25,7 +25,7 @@ jobs:
# Query our own dnf repo. If the version is there, we've already built it. # Query our own dnf repo. If the version is there, we've already built it.
# Strip leading 'v' because RPM versions don't use it. # Strip leading 'v' because RPM versions don't use it.
version="${UPSTREAM_TAG#v}" version="${UPSTREAM_TAG#v}"
if curl -sSfI "https://rpm.lair.cafe/fedora/43/x86_64/mistralrs-server-cuda13-fa-${version}-1.fc43.x86_64.rpm" | grep -q '^HTTP.*200'; then if curl --fail --silent --show-error --head --url "https://rpm.lair.cafe/fedora/43/x86_64/mistralrs-server-cuda13-${version}-1.fc43.x86_64.rpm" | grep -q '^HTTP.*200'; then
echo "already_built=true" >> "$GITHUB_OUTPUT" echo "already_built=true" >> "$GITHUB_OUTPUT"
else else
echo "already_built=false" >> "$GITHUB_OUTPUT" echo "already_built=false" >> "$GITHUB_OUTPUT"
@@ -36,8 +36,9 @@ jobs:
- name: Trigger build workflow - name: Trigger build workflow
if: steps.published.outputs.already_built == 'false' if: steps.published.outputs.already_built == 'false'
run: | run: |
curl -sSfL -X POST \ curl --fail --silent --show-error --location \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ --request POST \
-H 'Accept: application/json' \ --header "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/workflows/build-release.yml/dispatches" \ --header 'Accept: application/json' \
-d "{\"ref\":\"main\",\"inputs\":{\"tag\":\"${{ steps.upstream.outputs.tag }}\"}}" --url "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/actions/workflows/build-release.yml/dispatches" \
--data "{\"ref\":\"main\",\"inputs\":{\"tag\":\"${{ steps.upstream.outputs.tag }}\"}}"

View File

@@ -15,6 +15,8 @@ if rsync \
--archive \ --archive \
--compress \ --compress \
--verbose \ --verbose \
--rsync-path 'sudo rsync' \
--chown root:root \
${nginx_conf_local_path} \ ${nginx_conf_local_path} \
${nginx_host}:${nginx_conf_remote_path}; then ${nginx_host}:${nginx_conf_remote_path}; then
echo "sync'd ${nginx_conf_local_path} to ${nginx_host}:${nginx_conf_remote_path}" echo "sync'd ${nginx_conf_local_path} to ${nginx_host}:${nginx_conf_remote_path}"
@@ -24,7 +26,7 @@ else
fi fi
if ssh ${nginx_host} "id gitea_ci &> /dev/null || sudo useradd --system --create-home --home-dir /var/lib/gitea_ci gitea_ci"; then if ssh ${nginx_host} "id gitea_ci &> /dev/null || sudo useradd --system --create-home --home-dir /var/lib/gitea_ci gitea_ci"; then
echo "gitea_ci user created or observed on ${nginx_host}" echo "gitea_ci user created or observed on ${nginx_host}"
if ssh ${nginx_host} "sudo --user gitea_ci install --directory --mode 0700 /var/lib/gitea_ci/.ssh && echo '${gitea_ssh_key}' | sudo --user gitea_ci install --mode 0600 /dev/stdin /var/lib/gitea_ci/.ssh/authorized_keys"; then if ssh ${nginx_host} "sudo install --directory --owner gitea_ci --group gitea_ci --mode 0700 /var/lib/gitea_ci/.ssh && echo '${gitea_ssh_key}' | sudo sh -c 'install --owner gitea_ci --group gitea_ci --mode 0600 /dev/stdin /var/lib/gitea_ci/.ssh/authorized_keys'"; then
echo "gitea_ci ssh key installed on ${nginx_host}" echo "gitea_ci ssh key installed on ${nginx_host}"
else else
echo "failed to install gitea_ci ssh key on ${nginx_host}" echo "failed to install gitea_ci ssh key on ${nginx_host}"
@@ -40,7 +42,7 @@ else
echo "failed to create rpm repo directory on ${nginx_host}" echo "failed to create rpm repo directory on ${nginx_host}"
exit 1 exit 1
fi fi
if ssh ${nginx_host} "sudo ln -sf ${nginx_conf_remote_path} ${nginx_conf_remote_path/available/enabled} && sudo nginx -t ${nginx_conf_remote_path} && sudo systemctl reload nginx"; then if ssh ${nginx_host} "sudo ln -sf ${nginx_conf_remote_path} ${nginx_conf_remote_path/available/enabled} && sudo nginx -t && sudo systemctl reload nginx"; then
echo "nginx config reload on ${nginx_host} successful" echo "nginx config reload on ${nginx_host} successful"
else else
echo "nginx config reload on ${nginx_host} failed" echo "nginx config reload on ${nginx_host} failed"