Skip to content

chore: some visual updates (#260) #272

chore: some visual updates (#260)

chore: some visual updates (#260) #272

name: Docker Nightly
on:
push:
paths-ignore:
- "*.md"
- ".github/**"
- "!.github/workflows/docker-nightly.yml"
branches:
- main
workflow_dispatch:
jobs:
determine-changes:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set matrix
id: set-matrix
run: |
APPS=("web-app" "web-storefront" "web-parser" "atrium-telegram" "hub-telegram" "storefront-telegram" "core-telegram" "webinar")
CHANGED=()
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
CHANGED=("${APPS[@]}")
else
for app in "${APPS[@]}"; do
folder="apps/${app}"
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q "^${folder}/"; then
CHANGED+=("${app}")
fi
done
fi
if [ ${#CHANGED[@]} -gt 0 ]; then
echo "matrix=$(printf '%s\n' "${CHANGED[@]}" | jq -R . | jq -s . | tr -d '[:space:]')" >> $GITHUB_OUTPUT
else
echo "matrix=[]" >> $GITHUB_OUTPUT
fi
- name: Result
run: |
echo "${{ steps.set-matrix.outputs.matrix }}"
build:
needs: determine-changes
if: ${{ needs.determine-changes.outputs.matrix != '[]' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
app: ${{ fromJson(needs.determine-changes.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set APP in env
run: |
echo "APP_NAME=${{ matrix.app }}" >> $GITHUB_ENV
echo "APP_VERSION=nightly" >> $GITHUB_ENV
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build ${{ env.APP_NAME }}
uses: docker/build-push-action@v6
with:
context: .
file: docker/${{ env.APP_NAME }}/Dockerfile
push: true
build-args: |
APP_VERSION=${{ env.APP_VERSION }}
tags: ${{ secrets.DOCKER_REGISTRY }}/roll-stack/${{ env.APP_NAME }}:${{ env.APP_VERSION }}