diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/core.yaml similarity index 83% rename from .gitea/workflows/build.yaml rename to .gitea/workflows/core.yaml index fb93745..5d43dc7 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/core.yaml @@ -1,7 +1,8 @@ on: - push: - branches: - - main + workflow_run: + workflows: ["stage"] + types: + - completed jobs: build: @@ -35,26 +36,6 @@ jobs: username: ${{ vars.CONTAINER_REGISTRY_USERNAME }} password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} - - name: Restore stage3 cache - uses: actions/cache/restore@v4 - with: - path: fetch/bootstrap/stage3 - key: stage3-${{ hashFiles('packages/bootstrap/stage3/package.toml') }} - - name: Fetch stage3 - run: | - python3 ./src/fetch.py stage3 - - name: Save stage3 cache - uses: actions/cache/save@v4 - with: - path: fetch/bootstrap/stage3 - key: stage3-${{ hashFiles('packages/bootstrap/stage3/package.toml') }} - - name: Build stage3 - env: - CONTAINER_REGISTRY: ${{ vars.CONTAINER_REGISTRY }} - run: | - sed -i 's|stagex/bootstrap-stage2|docker.io/stagex/bootstrap-stage2|' packages/bootstrap/stage3/Containerfile - make registry-bootstrap-stage3 PROGRESS=plain BUILDER="docker buildx" PLATFORM=linux/amd64,linux/arm64 REGISTRY_USERNAME=$CONTAINER_REGISTRY/okami101/stagex - - name: Restore filesystem cache uses: actions/cache@v4 with: diff --git a/.gitea/workflows/stage.yaml b/.gitea/workflows/stage.yaml new file mode 100644 index 0000000..8f82df3 --- /dev/null +++ b/.gitea/workflows/stage.yaml @@ -0,0 +1,48 @@ +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + run: | + git config --global advice.detachedHead false + git clone --branch 2025.05.2 --depth 1 https://codeberg.org/stagex/stagex.git $GITHUB_WORKSPACE + + - name: Setup SSH for Buildx + uses: MrSquaare/ssh-setup-action@v3 + with: + host: 10.0.0.101 + private-key: ${{ secrets.RUNNER_SSH_PRIVATE_KEY }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + endpoint: ssh://root@10.0.0.101 + - uses: docker/login-action@v3 + with: + registry: ${{ vars.CONTAINER_REGISTRY }} + username: ${{ vars.CONTAINER_REGISTRY_USERNAME }} + password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} + + - name: Restore stage3 cache + uses: actions/cache/restore@v4 + with: + path: fetch/bootstrap/stage3 + key: stage3-${{ hashFiles('packages/bootstrap/stage3/package.toml') }} + - name: Fetch stage3 + run: | + python3 ./src/fetch.py stage3 + - name: Save stage3 cache + uses: actions/cache/save@v4 + with: + path: fetch/bootstrap/stage3 + key: stage3-${{ hashFiles('packages/bootstrap/stage3/package.toml') }} + - name: Build stage3 + env: + CONTAINER_REGISTRY: ${{ vars.CONTAINER_REGISTRY }} + run: | + sed -i 's|stagex/bootstrap-stage2|docker.io/stagex/bootstrap-stage2|' packages/bootstrap/stage3/Containerfile + make registry-bootstrap-stage3 PROGRESS=plain BUILDER="docker buildx" PLATFORM=linux/amd64,linux/arm64 REGISTRY_USERNAME=$CONTAINER_REGISTRY/okami101/stagex