From 85d6fdd213795e2a5bb291bc93531c7366c622b5 Mon Sep 17 00:00:00 2001 From: Wanjohi Date: Sun, 20 Jul 2025 23:46:05 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20ci:=20Update=20workflows=20to=20use?= =?UTF-8?q?=20dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docs.yml | 4 ++-- .github/workflows/relay.yml | 13 +++++++------ .github/workflows/runner.yml | 11 ++++++----- .github/workflows/www.yml | 4 ++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2c72abd0..62b4457a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,7 +6,7 @@ on: - "apps/docs/**" - ".github/workflows/docs.yml" push: - branches: [main] + branches: [dev] paths: - "apps/docs/**" - ".github/workflows/docs.yml" @@ -37,4 +37,4 @@ jobs: workingDirectory: "apps/docs" command: pages deploy ./dist --project-name=${{ vars.CF_DOCS_PAGES_PROJECT_NAME }} --commit-dirty=true env: - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} \ No newline at end of file + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} diff --git a/.github/workflows/relay.yml b/.github/workflows/relay.yml index 692ced3f..f5fca0b1 100644 --- a/.github/workflows/relay.yml +++ b/.github/workflows/relay.yml @@ -8,7 +8,7 @@ on: - "packages/relay/**" - ".github/workflows/relay.yml" push: - branches: [main] + branches: [dev, production] paths: - "containers/relay.Containerfile" - ".github/workflows/relay.yml" @@ -45,9 +45,9 @@ jobs: load: true tags: nestri:relay - build-docker-main: - name: Build image on main - if: ${{ github.ref == 'refs/heads/main' }} + build-and-push-docker: + name: Build and push image + if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/production' }} runs-on: ubuntu-latest permissions: contents: read @@ -73,7 +73,8 @@ jobs: #tag on release, and a nightly build for 'dev' tags: | type=raw,value=nightly,enable={{is_default_branch}} - type=ref,event=tag + type=raw,value={{branch}} + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'production') }} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} @@ -85,4 +86,4 @@ jobs: context: ./ push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index 9edd5033..a425a763 100644 --- a/.github/workflows/runner.yml +++ b/.github/workflows/runner.yml @@ -12,7 +12,7 @@ on: schedule: - cron: 7 0 * * 1,3,6 # Regularly to keep that build cache warm push: - branches: [main] + branches: [dev, production] paths: - "containers/runner.Containerfile" - ".github/workflows/runner.yml" @@ -66,9 +66,9 @@ jobs: cache-from: type=gha,mode=max cache-to: type=gha,mode=max - build-docker-main: - name: Build image on main - if: ${{ github.ref == 'refs/heads/main' }} + build-and-push-docker: + name: Build and push image + if: ${{ github.ref == 'refs/heads/production' || github.ref == 'refs/heads/dev' }} runs-on: ubuntu-latest permissions: contents: read @@ -94,7 +94,8 @@ jobs: #tag on release, and a nightly build for 'dev' tags: | type=raw,value=nightly,enable={{is_default_branch}} - type=ref,event=tag + type=raw,value={{branch}} + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'production') }} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} diff --git a/.github/workflows/www.yml b/.github/workflows/www.yml index 6190e36b..1cde4a82 100644 --- a/.github/workflows/www.yml +++ b/.github/workflows/www.yml @@ -6,7 +6,7 @@ on: - "apps/www/**" - ".github/workflows/www.yml" push: - branches: [main] + branches: [dev] paths: - "apps/www/**" - ".github/workflows/www.yml" @@ -37,4 +37,4 @@ jobs: workingDirectory: "apps/www" command: pages deploy ./dist --project-name=${{ vars.CF_WWW_PAGES_PROJECT_NAME }} --commit-dirty=true env: - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} \ No newline at end of file + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}