diff --git a/.github/workflows/_build-image.yml b/.github/workflows/_build-image.yml new file mode 100644 index 0000000..a931b5d --- /dev/null +++ b/.github/workflows/_build-image.yml @@ -0,0 +1,56 @@ +name: Build image + +on: + workflow_call: + inputs: + context: + required: true + type: string + image_name: + required: true + type: string + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + concurrency: + group: image-${{ inputs.image_name }}-${{ github.ref }} + cancel-in-progress: true + steps: + - name: Check out repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Set up Buildx + uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 + + - name: Log in to GHCR + uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Generate image metadata + id: meta + uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }} + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=sha,format=long + + - name: Build and push image + uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 + with: + context: ${{ inputs.context }} + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha,scope=${{ inputs.image_name }} + cache-to: type=gha,mode=max,scope=${{ inputs.image_name }} + provenance: mode=max + sbom: true diff --git a/.github/workflows/build-asr-pipeline.yml b/.github/workflows/build-asr-pipeline.yml new file mode 100644 index 0000000..4f70697 --- /dev/null +++ b/.github/workflows/build-asr-pipeline.yml @@ -0,0 +1,17 @@ +name: Build ASR Pipeline + +on: + push: + branches: [main] + paths: + - servers/tools-pve/asr-pipeline/** + - .github/workflows/_build-image.yml + - .github/workflows/build-asr-pipeline.yml + workflow_dispatch: + +jobs: + image: + uses: ./.github/workflows/_build-image.yml + with: + context: servers/tools-pve/asr-pipeline + image_name: arcane-asr-pipeline diff --git a/.github/workflows/build-snell-dc9.yml b/.github/workflows/build-snell-dc9.yml new file mode 100644 index 0000000..d633a1a --- /dev/null +++ b/.github/workflows/build-snell-dc9.yml @@ -0,0 +1,17 @@ +name: Build Snell DC9 + +on: + push: + branches: [main] + paths: + - servers/bwh-us-dc9/snell/** + - .github/workflows/_build-image.yml + - .github/workflows/build-snell-dc9.yml + workflow_dispatch: + +jobs: + image: + uses: ./.github/workflows/_build-image.yml + with: + context: servers/bwh-us-dc9/snell + image_name: arcane-snell-dc9 diff --git a/.github/workflows/build-snell-hk.yml b/.github/workflows/build-snell-hk.yml new file mode 100644 index 0000000..4009275 --- /dev/null +++ b/.github/workflows/build-snell-hk.yml @@ -0,0 +1,17 @@ +name: Build Snell HK + +on: + push: + branches: [main] + paths: + - servers/bwh-hk-cmi/snell/** + - .github/workflows/_build-image.yml + - .github/workflows/build-snell-hk.yml + workflow_dispatch: + +jobs: + image: + uses: ./.github/workflows/_build-image.yml + with: + context: servers/bwh-hk-cmi/snell + image_name: arcane-snell-hk diff --git a/.github/workflows/build-wechat-fulltext.yml b/.github/workflows/build-wechat-fulltext.yml new file mode 100644 index 0000000..678e090 --- /dev/null +++ b/.github/workflows/build-wechat-fulltext.yml @@ -0,0 +1,17 @@ +name: Build WeChat Fulltext + +on: + push: + branches: [main] + paths: + - servers/tools-pve/wechat-fulltext/** + - .github/workflows/_build-image.yml + - .github/workflows/build-wechat-fulltext.yml + workflow_dispatch: + +jobs: + image: + uses: ./.github/workflows/_build-image.yml + with: + context: servers/tools-pve/wechat-fulltext + image_name: arcane-wechat-fulltext