Skip to content

fix(api): expose api under subdomain #36

fix(api): expose api under subdomain

fix(api): expose api under subdomain #36

Workflow file for this run

name: Build and Push
on:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: true
env:
TAG: ${{ github.sha }}
REGISTRY: ${{ vars.REGISTRY_URL }}/xgeeks/intelli-mate
jobs:
build-push:
name: Build and Push
runs-on: [ ubuntu-latest ]
strategy:
matrix:
app: ['web-ui', 'api']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to docker registry
uses: docker/login-action@v2
with:
registry: ${{env.REGISTRY}}/${{ matrix.app }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Setup Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{env.REGISTRY}}/${{ matrix.app }}
tags: |
type=raw,value=${{ env.TAG }}
type=raw,value=cache
flavor: |
latest=false
- name: Build and Push ${{ matrix.app }}
uses: docker/build-push-action@v4
with:
context: packages
file: packages/${{ matrix.app }}/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=registry,ref=${{ ENV.REGISTRY }}:${{ env.TAG }}
type=registry,ref=${{ ENV.REGISTRY }}:${{ env.TAG }}:cache
cache-to: type=inline
deploy-production:
name: Deploy
needs: build-push
uses: ./.github/workflows/on-call-deploy.yaml
strategy:
matrix:
app: ['web-ui', 'api']
with:
ENVIRONMENT: production
APP: ${{ matrix.app }}
secrets: inherit