ci: release workflow without GitHub actions (network blocked) - pure run steps
Some checks failed
Release: ARM64 Docker Image / build-arm64 (push) Failing after 12s
Some checks failed
Release: ARM64 Docker Image / build-arm64 (push) Failing after 12s
- GitHub unreachable on prod network; actions/checkout@v4 etc fail to download - Rewrite release.yaml using only run: steps (git clone from Gitea, docker build/push) - Clone uses REGISTRY_TOKEN (oauth2) from Gitea secrets - Registry push is best-effort; always saves image tarball artifact
This commit is contained in:
@@ -7,46 +7,54 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-arm64:
|
build-arm64:
|
||||||
# Нативный ARM64 runner на Orange Pi Zero 2 (aarch64)
|
# Нативный ARM64 runner на Orange Pi Zero 2 (aarch64).
|
||||||
# Сборка без QEMU-эмуляции — быстрее и стабильнее для npm install / node-gyp
|
# GitHub недоступен в этой сети — НЕ используем actions/*, только чистые run: шаги.
|
||||||
runs-on: arm64
|
runs-on: arm64
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
set -e
|
||||||
|
cd /tmp
|
||||||
|
rm -rf release-src
|
||||||
|
git clone --depth 1 --branch "${GITHUB_REF_NAME}" \
|
||||||
|
"https://oauth2:${REGISTRY_TOKEN}@git.softuniq.eu/Telegram-Market/telegram-shop.git" release-src
|
||||||
|
cd release-src
|
||||||
|
git rev-parse --short HEAD
|
||||||
|
|
||||||
- name: Extract tag
|
- name: Extract version
|
||||||
id: meta
|
id: meta
|
||||||
run: |
|
run: |
|
||||||
TAG=${GITHUB_REF_NAME#v}
|
VERSION=${GITHUB_REF_NAME#v}
|
||||||
echo "version=$TAG" >> "$GITHUB_OUTPUT"
|
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
|
||||||
echo "image=git.softuniq.eu/telegram-market/telegram-shop" >> "$GITHUB_OUTPUT"
|
echo "Build version: ${VERSION}"
|
||||||
|
|
||||||
- name: Build ARM64 image
|
- name: Build ARM64 image
|
||||||
|
working-directory: /tmp/release-src
|
||||||
run: |
|
run: |
|
||||||
|
set -e
|
||||||
docker build \
|
docker build \
|
||||||
--file ./Dockerfile \
|
--file ./Dockerfile \
|
||||||
--tag ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }} \
|
--tag git.softuniq.eu/telegram-market/telegram-shop:${VERSION} \
|
||||||
--tag ${{ steps.meta.outputs.image }}:latest \
|
--tag git.softuniq.eu/telegram-market/telegram-shop:latest \
|
||||||
.
|
.
|
||||||
|
|
||||||
- name: Log in to Gitea Container Registry (best effort)
|
- name: Push to Gitea Container Registry (best effort)
|
||||||
id: login
|
working-directory: /tmp/release-src
|
||||||
continue-on-error: true
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: git.softuniq.eu
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
- name: Push image to Gitea Container Registry
|
|
||||||
if: steps.login.outcome == 'success'
|
|
||||||
run: |
|
run: |
|
||||||
docker push ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }}
|
set -e
|
||||||
docker push ${{ steps.meta.outputs.image }}:latest
|
echo "${REGISTRY_TOKEN}" | docker login git.softuniq.eu -u oauth2 --password-stdin \
|
||||||
|
|| { echo "registry login failed, skipping push"; exit 0; }
|
||||||
|
docker push git.softuniq.eu/telegram-market/telegram-shop:${VERSION} \
|
||||||
|
|| echo "push tag failed (may need package scope)"
|
||||||
|
docker push git.softuniq.eu/telegram-market/telegram-shop:latest \
|
||||||
|
|| echo "push latest failed (may need package scope)"
|
||||||
|
docker logout git.softuniq.eu || true
|
||||||
|
|
||||||
- name: Save image tarball
|
- name: Save image tarball artifact
|
||||||
|
working-directory: /tmp/release-src
|
||||||
run: |
|
run: |
|
||||||
|
set -e
|
||||||
mkdir -p /tmp/release-artifacts
|
mkdir -p /tmp/release-artifacts
|
||||||
docker save ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }} \
|
docker save git.softuniq.eu/telegram-market/telegram-shop:${VERSION} \
|
||||||
-o /tmp/release-artifacts/telegram-shop-arm64-${{ steps.meta.outputs.version }}.tar
|
-o /tmp/release-artifacts/telegram-shop-arm64-${VERSION}.tar
|
||||||
ls -la /tmp/release-artifacts/
|
ls -lah /tmp/release-artifacts/
|
||||||
|
|||||||
Reference in New Issue
Block a user