From 4e9e617fa3c93967895865e39af844c3a00fbaed Mon Sep 17 00:00:00 2001 From: Rodney Osodo Date: Fri, 29 Nov 2024 14:07:28 +0300 Subject: [PATCH] fix(ci): use github token for UI CI/CD Use `GITHUB_TOKEN` rather than `GITHUBPAT` when publishing UI docker image. Also use with option rather than adding an extra step for fetching github tags Signed-off-by: Rodney Osodo --- .github/workflows/cd.yaml | 8 ++------ .github/workflows/ui-ci.yaml | 8 ++++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index eb40c32..7e96cda 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -12,12 +12,10 @@ on: paths: - ".github/workflows/cd.yaml" - "**.go" - workflow_dispatch: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} jobs: build-and-push-image: @@ -30,10 +28,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - - name: Fetch tags for the build - run: | - git fetch --prune --unshallow --tags + with: + fetch-depth: 0 - name: Set up Docker Build uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/ui-ci.yaml b/.github/workflows/ui-ci.yaml index e371da0..b9f43f2 100644 --- a/.github/workflows/ui-ci.yaml +++ b/.github/workflows/ui-ci.yaml @@ -7,7 +7,9 @@ on: schedule: - cron: '0 8 * * 6' push: - branches: [main] + branches: + - main + workflow_dispatch: env: REGISTRY: ghcr.io @@ -25,12 +27,14 @@ jobs: uses: actions/checkout@v4 with: path: cube + fetch-depth: 0 - name: Checkout UI repository uses: actions/checkout@v4 with: repository: absmach/magistrala-ui-new path: ui + fetch-depth: 0 token: ${{ secrets.GITHUBPAT }} - name: Log in to GitHub Container Registry @@ -38,7 +42,7 @@ jobs: with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} - password: ${{ secrets.GITHUBPAT }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Set UI Type in .env File run: |