Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lehmanju committed Apr 16, 2024
0 parents commit 5cd6b5e
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build-all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Build and deploy images
on:
push:
branches: [main]

jobs:
build-hd-idle:
uses: ./.github/workflows/build-image.yaml
with:
imageName: hd-idle

49 changes: 49 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
name: Create and publish a Docker image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
workflow_call:
inputs:
imageName:
type: string
required: true

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
build-and-push-image:
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
#
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build Image
id: build-image
uses: redhat-actions/[email protected]
with:
image: ${{ inputs.imageName }}
tags: latest ${{ github.sha }}
containerfiles: |
./images/${{ inputs.imageName }}/Containerfile
# Podman Login action (https://github.com/redhat-actions/podman-login) also be used to log in,
# in which case 'username' and 'password' can be omitted.
- name: Push To github repo
id: push-to-github
uses: redhat-actions/[email protected]
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions images/hd-idle/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:latest


RUN curl -L -O https://github.com/adelolmo/hd-idle/releases/download/v1.21/hd-idle_1.21_amd64.deb
RUN apt update && dpkg --install hd-idle_1.21_amd64.deb && rm hd-idle_1.21_amd64.deb

ENTRYPOINT [ "hd-idle" ]

0 comments on commit 5cd6b5e

Please sign in to comment.