feat: Add logging interceptor to AppController and SourceController #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |