diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..4791e4f --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,44 @@ +name: Build and Push Continuwuity + +on: + repository_dispatch: + types: [continuwuity-push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout Continuwuity + uses: actions/checkout@v4 + with: + repository: ember/continuwuity + ref: ${{ github.event.client_payload.ref || 'main' }} + + - name: Install Rust + uses: https://github.com/dtolnay/rust-toolchain@stable + + - name: Run tests + run: cargo test --workspace + + build-and-push: + runs-on: ubuntu-latest + needs: test + steps: + - name: Checkout Continuwuity + uses: actions/checkout@v4 + with: + repository: ember/continuwuity + ref: ${{ github.event.client_payload.ref || 'main' }} + + - name: Build container image + run: | + SHA=${{ github.event.client_payload.sha || 'latest' }} + docker build -t 10.70.69.22:30500/ember/continuwuity:latest \ + -t 10.70.69.22:30500/ember/continuwuity:${SHA} \ + -f docker/Dockerfile . + + - name: Push to Zot + run: | + SHA=${{ github.event.client_payload.sha || 'latest' }} + docker push 10.70.69.22:30500/ember/continuwuity:latest + docker push 10.70.69.22:30500/ember/continuwuity:${SHA}