Skip to content

missing presence from tf #6

missing presence from tf

missing presence from tf #6

name: Build and Push
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: build-and-push
cancel-in-progress: false
env:
DOCKER_REPO: "${{ vars.DOCKER_REGISTRY }}/braden-lol"
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
app:
- name: Web
image_name: web
app_dir: apps/web
- name: Presence
image_name: presence
app_dir: apps/presence
name: Build and Push ${{ matrix.app.name }}
env:
IMAGE_EXISTS: "false"
steps:
- name: Checkout
uses: actions/checkout@v4
- id: app-version
name: Get app version
uses: martinbeentjes/npm-get-version-action@v1.3.1
with:
path: ${{ matrix.app.app_dir }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Check if image exists
run: |
if docker manifest inspect ${{ env.DOCKER_REPO }}/${{ matrix.app.image_name }}:v${{ steps.app-version.outputs.current-version }} 2>/dev/null; then
echo "IMAGE_EXISTS=true" >> $GITHUB_ENV
fi
- name: Build and push image
uses: docker/build-push-action@v6
if: ${{ env.IMAGE_EXISTS == 'false' }}
with:
context: .
file: ${{ matrix.app.app_dir }}/Dockerfile
push: true
tags: |
${{ env.DOCKER_REPO }}/${{ matrix.app.image_name }}:v${{ steps.app-version.outputs.current-version }}
${{ env.DOCKER_REPO }}/${{ matrix.app.image_name }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max