Skip to content

Commit

Permalink
fix(ci): use github token for UI CI/CD
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rodneyosodo committed Nov 29, 2024
1 parent 7a84cce commit 4e9e617
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ui-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:
schedule:
- cron: '0 8 * * 6'
push:
branches: [main]
branches:
- main
workflow_dispatch:

env:
REGISTRY: ghcr.io
Expand All @@ -25,20 +27,22 @@ 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
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUBPAT }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set UI Type in .env File
run: |
Expand Down

0 comments on commit 4e9e617

Please sign in to comment.