From f9123097efc42d72b9ccbd866f8f3a1b88a255d6 Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Wed, 10 Sep 2025 12:23:54 +0200 Subject: [PATCH] ci: replace sync_submodules step with init/update built-in --- .gitea/workflows/dev.yml | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .gitea/workflows/dev.yml diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml new file mode 100644 index 0000000..c91ff67 --- /dev/null +++ b/.gitea/workflows/dev.yml @@ -0,0 +1,45 @@ +name: dev +on: + push: + tags: + - dev + branches: + - 'dev' + paths: + - '.ci/tag.env' +jobs: + build-and-push: + runs-on: docker + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Gitea Registry + uses: docker/login-action@v3 + with: + registry: git.4nkweb.com + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - name: Init submodules (ensure up-to-date) + run: | + git submodule sync --recursive + git submodule update --init --recursive + - name: Build and push images + env: + REGISTRY: git.4nkweb.com + run: | + COMMIT_MSG=$(git log -1 --pretty=%B) + FROM_COMMIT=$(printf "%s" "$COMMIT_MSG" | sed -n 's/.*ci:[[:space:]]*docker_tag=\([^ ][^\n]*\).*/\1/p' | head -n1) + if [ -n "$FROM_COMMIT" ]; then + DOCKER_TAG="$FROM_COMMIT" + elif [ -f .ci/tag.env ]; then + # shellcheck disable=SC1091 + . .ci/tag.env + else + DOCKER_TAG="${GITHUB_REF_NAME:-dev-test}" + fi + bash scripts/build_and_push.sh "$DOCKER_TAG"