Skip to content

feat: auto build

feat: auto build #17

Workflow file for this run

name: Build
on:
push:
branches:
- main
jobs:
changes:
runs-on: ubuntu-latest
outputs:
apps: ${{ steps.filter.outputs.apps }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Filter changed paths
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
account/server:
- 'account/server/**'
auth/server:
- 'auth/server/**'
- name: Generate matrix dynamically
id: set-matrix
run: |
echo ${{ steps.filter.outputs.files }}
build:
needs: changes
runs-on: ubuntu-latest
strategy:
matrix:
APP_DIR: ${{ fromJSON(needs.changes.outputs.apps) }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to the Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/noah-platform/noah/${{ matrix.APP_DIR }}:latest
build-args: |
APP_DIR=${{ matrix.APP_DIR }}
cache-from: type=gha
cache-to: type=gha,mode=max