Skip to content

fix: fix pipeline

fix: fix pipeline #9

Workflow file for this run

name: CICD Staging
on:
push:
branches:
- develop
env:
IMAGE_TAG: ghcr.io/ce-smart-career/${{ github.event.repository.name }}-stg:latest
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GTK_STG }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ env.IMAGE_TAG }}
secrets: |
NOCODB_API_TOKEN=${{ secrets.NOCODB_API_TOKEN }}
NOCODB_API_URL=${{ secrets.NOCODB_API_URL }}
deploy:
name: deploy
needs: ['build']
runs-on: [self-hosted, runner-stg]
steps:
- name: Login to GitHub Container Registry
run: |
echo "${{ secrets.GTK_STG }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Pull Docker Image
run: docker pull ${{ env.IMAGE_TAG }}
- name: Run Docker Image
run: |
docker run --name ce-smart-career-2024-stg \
-e NOCODB_API_URL=${{ secrets.NOCODB_API_URL }} \
-e NOCODB_API_TOKEN=${{ secrets.NOCODB_API_TOKEN }} \
-dp 3000:3000 \
${{ env.IMAGE_TAG }}