Skip to content

Commit bfa45fb

Browse files
author
James Brundage
committed
feat: HtmxPS Dockerfile and Publishing Workflow ( Fixes #26, Fixes #30 )
1 parent d9b7d92 commit bfa45fb

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/workflows/BuildHtmxPS.yml

+40
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,46 @@ jobs:
504504
uses: StartAutomating/EZOut@master
505505
- name: UseHelpOut
506506
uses: StartAutomating/HelpOut@master
507+
- name: Log in to ghcr.io
508+
uses: docker/login-action@master
509+
with:
510+
registry: ${{ env.REGISTRY }}
511+
username: ${{ github.actor }}
512+
password: ${{ secrets.GITHUB_TOKEN }}
513+
env:
514+
REGISTRY: ghcr.io
515+
- name: Extract Docker Metadata (for branch)
516+
if: ${{github.ref_name != 'main' && github.ref_name != 'master' && github.ref_name != 'latest'}}
517+
id: meta
518+
uses: docker/metadata-action@master
519+
with:
520+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
521+
env:
522+
REGISTRY: ghcr.io
523+
IMAGE_NAME: ${{ github.repository }}
524+
- name: Extract Docker Metadata (for main)
525+
if: ${{github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'latest'}}
526+
id: metaMain
527+
uses: docker/metadata-action@master
528+
with:
529+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
530+
flavor: latest=true
531+
- name: Build and push Docker image (from main)
532+
if: ${{github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'latest'}}
533+
uses: docker/build-push-action@master
534+
with:
535+
context: .
536+
push: true
537+
tags: ${{ steps.metaMain.outputs.tags }}
538+
labels: ${{ steps.metaMain.outputs.labels }}
539+
- name: Build and push Docker image (from branch)
540+
if: ${{github.ref_name != 'main' && github.ref_name != 'master' && github.ref_name != 'latest'}}
541+
uses: docker/build-push-action@master
542+
with:
543+
context: .
544+
push: true
545+
tags: ${{ steps.meta.outputs.tags }}
546+
labels: ${{ steps.meta.outputs.labels }}
507547
env:
508548
REGISTRY: ghcr.io
509549
IMAGE_NAME: ${{ github.repository }}

Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Thank you Microsoft! Thank you PowerShell! Thank you Docker!
2+
FROM mcr.microsoft.com/powershell AS powershell
3+
4+
# Set the module name to the name of the module we are building
5+
ENV ModuleName=HtmxPS
6+
ENV InstallAptGet="git","curl","ca-certificates","libc6","libgcc1"
7+
ENV InstallModule="ugit"
8+
# Copy the module into the container
9+
RUN --mount=type=bind,src=./,target=/Initialize /bin/pwsh -nologo -command /Initialize/Container.init.ps1
10+
# Set the entrypoint to the script we just created.
11+
ENTRYPOINT [ "/bin/pwsh","-nologo","-noexit","-file","/Container.start.ps1" ]

0 commit comments

Comments
 (0)