From b4c07a3902313ecbb5b0ddffa1c43bdb7b48b0ab Mon Sep 17 00:00:00 2001 From: Justine Pelletreau Date: Mon, 17 Jul 2023 17:16:09 +0200 Subject: [PATCH] Added actions --- .gitea/workflows/build.yml | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .gitea/workflows/build.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..13d2605 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,67 @@ +name: Rust-build + +on: + push: + branches: + - "main" + +jobs: + build: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + steps: + + - name: Check-out + uses: actions/checkout@v3 + + - name: Install stable toolchain + uses: https://github.com/actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Run cargo check + uses: https://github.com/actions-rs/cargo@v1 + with: + command: check + + - name: Test + run: cargo test + + - name: Build + run: cargo build --release + + build-docker: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 # all history for all branches and tags + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to registry + uses: docker/login-action@v2 + with: + registry: gitea.squi.fr + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v4 + env: + ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119 + with: + context: . + file: ./Dockerfile + platforms: | + linux/amd64 + linux/arm64 + push: true + tags: gitea.squi.fr/rust/sqpad:latest