Skip to content

feat: Add current time endpoint to AppController and fix typo in NewD… #7

feat: Add current time endpoint to AppController and fix typo in NewD…

feat: Add current time endpoint to AppController and fix typo in NewD… #7

name: Build API Gateway
on:
push:
paths: ["api_gateway/**"]
branches:
- main
env:
SHORT_SHA: ${{ github.sha }}
IMAGE_NAME: ${{ github.repository_owner }}/mini-etl-api-gateway
IMAGE_TAG: ${{ github.ref_type == 'tag' && github.ref || contains(github.event.head_commit.message, 'latest') && 'latest' || 'dev' }}
jobs:
build-deploy:
if: github.repository_owner == 'monzim'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./api_gateway
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: 🔑 Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GCR_TOKEN }}
- name: 🏗️ Build and push
run: |
if [[ $IMAGE_TAG == *"refs/tags/"* ]]; then
IMAGE_TAG=$(echo $IMAGE_TAG | sed 's/refs\/tags\///')
export IMAGE_TAG
fi
echo "==>> IMAGE_TAG: $IMAGE_TAG"
docker build -t ghcr.io/${{ env.IMAGE_NAME }}:$IMAGE_TAG -t ghcr.io/${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }} .
docker push ghcr.io/${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }}
docker push ghcr.io/${{ env.IMAGE_NAME }}:$IMAGE_TAG