From 71b750fa5ed865451d33ca2ce64d25eadce22d7d Mon Sep 17 00:00:00 2001 From: Jannik Date: Sat, 6 Sep 2025 12:51:24 +0200 Subject: [PATCH] build: seperate CI and CD --- .gitea/workflows/cd.yml | 26 ++++++++++++++++++++++++++ .gitea/workflows/ci.yml | 20 +------------------- 2 files changed, 27 insertions(+), 19 deletions(-) create mode 100644 .gitea/workflows/cd.yml diff --git a/.gitea/workflows/cd.yml b/.gitea/workflows/cd.yml new file mode 100644 index 0000000..c17552e --- /dev/null +++ b/.gitea/workflows/cd.yml @@ -0,0 +1,26 @@ +name: TrafficCue Server CD +on: + push: + branches: + - main + - staging + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Login to Registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.registry_url }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v2 + - name: Build image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ vars.registry_url }}/trafficcue/trafficcue-server:${{ gitea.ref_name == 'main' && 'latest' || gitea.ref_name }} + platforms: linux/amd64 diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 1f469d1..fff199e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -13,22 +13,4 @@ jobs: - run: bunx prettier --check . - run: bun test env: - DATABASE_URL: ${{ secrets.DATABASE_URL }} - build: - runs-on: ubuntu-latest - steps: - - name: Login to Registry - uses: docker/login-action@v3 - with: - registry: ${{ vars.registry_url }} - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - uses: actions/checkout@v4 - - uses: docker/setup-buildx-action@v2 - - name: Build image - uses: docker/build-push-action@v4 - with: - context: . - push: true - tags: ${{ vars.registry_url }}/trafficcue/trafficcue-server:${{ gitea.ref_name == 'main' && 'latest' || gitea.ref_name }} - platforms: linux/amd64 + DATABASE_URL: ${{ secrets.DATABASE_URL }} \ No newline at end of file