Remove working-dir #200
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- main | |
paths: | |
- 'controller/**' | |
- 'modules/**' | |
- 'scripts/**' | |
- '.github/**' | |
env: | |
REGISTRY: ghcr.io | |
REPO_LC: sensors | |
jobs: | |
build-and-push-controller: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Run Build and Publish Docker image | |
id: controller | |
uses: ./.github/actions/docker-push | |
with: | |
registry: ${{ env.REGISTRY }} | |
repository_lc: ${{ env.REPO_LC }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
image-name: controller | |
tag-name: ${{ github.ref_name }} | |
context: controller | |
file: controller/Dockerfile | |
platforms: '' | |
define-module-device: | |
runs-on: ubuntu-latest | |
outputs: | |
include: ${{ steps.include.outputs.include }} | |
modules: ${{ steps.modules.outputs.modules }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Define Module Device Matrix | |
id: include | |
run: | | |
echo "include=$(sh ./scripts/list-module-device.sh)\n" >> $GITHUB_OUTPUT | |
- name: Define Modules | |
id: modules | |
run: | | |
echo "modules=$(sh ./scripts/list-directories.sh modules json)\n" >> $GITHUB_OUTPUT | |
build-and-push-devices: | |
runs-on: ubuntu-latest | |
needs: define-module-device | |
strategy: | |
matrix: | |
include: ${{ fromJSON(needs.define-module-device.outputs.include) }} | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Run Build and Publish Docker image | |
id: devices | |
uses: ./.github/actions/docker-push | |
with: | |
registry: ${{ env.REGISTRY }} | |
repository_lc: ${{ env.REPO_LC }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
image-name: device/${{ matrix.device }} | |
tag-name: ${{ github.ref_name }}-${{ matrix.module }} | |
context: modules/${{ matrix.module }}/devices/${{ matrix.device }} | |
file: modules/${{ matrix.module }}/devices/${{ matrix.device }}/Dockerfile | |
platforms: linux/arm64 | |
build-and-push-modules: | |
runs-on: ubuntu-latest | |
needs: | |
- define-module-device | |
- build-and-push-devices | |
strategy: | |
matrix: | |
module: ${{ fromJSON(needs.define-module-device.outputs.modules) }} | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Generate Module Device list | |
id: devices_list | |
shell: sh | |
run: echo "devices=$(sh ./scripts/list-directories.sh modules/${{ matrix.module }}/devices csv)\n" >> $GITHUB_OUTPUT | |
- name: Generate Module Dockerfile | |
id: generate_dockerfile | |
shell: sh | |
run: sh ./scripts/generate-module-dockerfile.sh ${{ matrix.module }} ${{ steps.devices_list.outputs.devices }} ${{ env.REGISTRY }} ${{ github.repository_owner }} ${{ env.REPO_LC }} ${{ github.ref_name }} modules/${{ matrix.module }}/Dockerfile | |
- name: Run Build and Publish Docker image | |
id: modules | |
uses: ./.github/actions/docker-push | |
with: | |
registry: ${{ env.REGISTRY }} | |
repository_lc: ${{ env.REPO_LC }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
image-name: module/${{ matrix.module }} | |
tag-name: ${{ github.ref_name }} | |
file: modules/${{ matrix.module }}/Dockerfile | |
platforms: linux/arm64 |