Skip to content

wip

wip #55

Workflow file for this run

name: CD
on:
push:
# branches: ['main']
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
strategy:
matrix:
folders:
- infra/postgres
- infra/keycloak
- infra/nginx
- infra/loki
- infra/prometheus
- infra/grafana
- apps/api
- apps/ui
steps:
- uses: actions/checkout@v4
- name: Sets the folder and application names for the build
id: set-folder
run: |
echo "folder=$(dirname ${{ matrix.folders }})" >> $GITHUB_ENV
echo "app=$(basename ${{ matrix.folders }})" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
context: .
file: ./${{ env.folder }}/${{ env.app }}/Dockerfile
push: true
tags: ghcr.io/neumanf/mally-${{ env.app }}:latest
deploy:
runs-on: self-hosted
needs: build
steps:
- name: Deploy
run: |
cd $HOME/mally &&
docker compose -f docker-compose.stack.yml pull &&
export $(cat .env) &&
docker stack deploy -c docker-compose.stack.yml mally