Skip to content

Commit

Permalink
Added new workflow (#43)
Browse files Browse the repository at this point in the history
Adding new workflow for ghcr image publishing.
  • Loading branch information
ethanperry1 authored Dec 5, 2023
1 parent 9f4bef4 commit 974c295
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions .github/workflows/industrial_data_simulator_ghcr.yml
Original file line number Diff line number Diff line change
@@ -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: .
3 changes: 3 additions & 0 deletions samples/industrial-data-simulator/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 974c295

Please sign in to comment.