diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml new file mode 100644 index 0000000..3ac2df1 --- /dev/null +++ b/.github/workflows/ghcr.yml @@ -0,0 +1,36 @@ +name: deploy_ghcr + +on: + workflow_call: + inputs: + file: + required: true + type: string + context: + required: true + type: string + name: + required: true + type: string + +jobs: + push-store-image: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - name: "Checkout GitHub Action" + uses: actions/checkout@main + + - name: "Login to GitHub Container Registry" + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + + - name: "Build Inventory Image" + run: | + docker build ${{ inputs.context }} -f ${{ inputs.file }} --tag ghcr.io/azure-samples/explore-iot-operations/${{ inputs.name }}:latest + docker push ghcr.io/azure-samples/explore-iot-operations/${{ inputs.name }}:latest diff --git a/.github/workflows/industrial_data_simulator_ghcr.yml b/.github/workflows/industrial_data_simulator_ghcr.yml new file mode 100644 index 0000000..537398a --- /dev/null +++ b/.github/workflows/industrial_data_simulator_ghcr.yml @@ -0,0 +1,12 @@ +name: industrial_data_simulator_ghcr + +on: + workflow_dispatch: + +jobs: + call-docker-build: + uses: ./.github/workflows/ghcr.yml + with: + name: industrial-data-simulator + file: samples/industrial-data-simulator/Dockerfile + context: . \ No newline at end of file diff --git a/samples/industrial-data-simulator/Dockerfile b/samples/industrial-data-simulator/Dockerfile index cbf0dbe..e52860e 100644 --- a/samples/industrial-data-simulator/Dockerfile +++ b/samples/industrial-data-simulator/Dockerfile @@ -1,6 +1,9 @@ # syntax=docker/dockerfile:1 FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21-cbl-mariner2.0 AS build +LABEL org.opencontainers.image.source=https://github.com/Azure-Samples/explore-iot-operations +LABEL org.opencontainers.image.description="Industrial data simulator" +LABEL org.opencontainers.image.licenses=MIT COPY ./lib /workdir/lib