From 533ec170ae3076986a2b0f5f495ec4fd9f8b08ee Mon Sep 17 00:00:00 2001 From: DataHearth Date: Fri, 23 Jun 2023 16:07:02 +0200 Subject: [PATCH] setup actions --- .github/workflow/container.yml | 46 ++++++++++++++++++++++++++++++++++ .github/workflow/rust.yml | 22 ++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflow/container.yml create mode 100644 .github/workflow/rust.yml diff --git a/.github/workflow/container.yml b/.github/workflow/container.yml new file mode 100644 index 0000000..36eb140 --- /dev/null +++ b/.github/workflow/container.yml @@ -0,0 +1,46 @@ +name: Docker + +on: + push: + tags: ["v*.*.*"] + +jobs: + build-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v4 + + - name: Log into registry Docker + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Log into registry Gitea + uses: docker/login-action@v2 + with: + registry: gitea.antoine-langlois.net + username: ${{ github.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: | + datahearth/tech-bot + gitea.antoine-langlois.net/datahearth/tech-bot + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v4 + with: + push: true + tags: ${{ steps.meta.outputs.tags }}} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflow/rust.yml b/.github/workflow/rust.yml new file mode 100644 index 0000000..8621a94 --- /dev/null +++ b/.github/workflow/rust.yml @@ -0,0 +1,22 @@ +name: Rust + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +env: + CARGO_TERM_COLOR: always + +jobs: + test-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose