diff --git a/.gitea/workflows/build_docker.yaml b/.gitea/workflows/build_docker.yaml new file mode 100644 index 0000000..a74c55b --- /dev/null +++ b/.gitea/workflows/build_docker.yaml @@ -0,0 +1,51 @@ +name: Build Project + +on: [push] +jobs: + test: + runs-on: ubuntu-latest + container: + image: rust:latest + + # Service containers to run with `container-job` + services: + # Label used to access the service container + db: + # Docker Hub image + image: postgres:latest + # Provide the password for postgres + env: + POSTGRES_USER: dev + POSTGRES_PASSWORD: dev + POSTGRES_DB: iot + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + + steps: + - run: apt update && apt install nodejs -y + - name: Checkout Code + uses: actions/checkout@v2 + - name: Run migrations + run: cargo install sqlx-cli && sqlx migrate run + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Log in to Docker Registry + uses: docker/login-action@v1 + with: + registry: gitea.maiertobi.de # Replace with your Docker registry URL + username: tobimai + password: ${{ secrets.docker_registry_key }} + - name: Build and Push Docker Image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: gitea.maiertobi.de/tobimai/iot # Replace with your Docker image's details + + diff --git a/.gitea/workflows/release_actions.yaml b/.gitea/workflows/test_build.yaml similarity index 92% rename from .gitea/workflows/release_actions.yaml rename to .gitea/workflows/test_build.yaml index 5b9db18..046aa44 100644 --- a/.gitea/workflows/release_actions.yaml +++ b/.gitea/workflows/test_build.yaml @@ -1,11 +1,6 @@ name: Build Project -on: - push: - branches: [ main, dev ] - pull_request: - branches: [ main ] - +on: [push] jobs: test: runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..28b1a76 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM alpine:latest +RUN apk add htop \ No newline at end of file