-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 4bitcss in Docker ( Fixes #50 )
- Loading branch information
James Brundage
committed
Apr 20, 2024
1 parent
5330010
commit b5b717b
Showing
4 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#requires -Module PSDevOps | ||
Push-Location ($PSScriptRoot | Split-Path) | ||
Import-BuildStep -SourcePath ( | ||
Join-Path $PSScriptRoot 'GitHub' | ||
) -BuildSystem GitHubWorkflow | ||
|
||
New-GitHubWorkflow -Name "Build 4bitcss" -On Push, PullRequest, Demand -Job TestPowerShellOnLinux, TagReleaseAndPublish, Build4BitCss -Environment @{ | ||
NoCoverage = $true | ||
REGISTRY = "ghcr.io" | ||
IMAGE_NAME = '${{ github.repository }}' | ||
} -OutputPath (Join-Path $pwd .github\workflows\Build4bitcss.yml) | ||
|
||
Pop-Location |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
@{ | ||
"runs-on" = "ubuntu-latest" | ||
if = '${{ success() }}' | ||
steps = @( | ||
@{ | ||
name = 'Check out repository' | ||
uses = 'actions/checkout@v2' | ||
}, | ||
@{ | ||
name = 'Use PSSVG Action' | ||
uses = 'StartAutomating/PSSVG@main' | ||
id = 'PSSVG' | ||
}, | ||
'RunEZOut', | ||
@{ | ||
name = 'PipeScript' | ||
uses = 'StartAutomating/PipeScript@main' | ||
id = 'PipeScript' | ||
with = @{ | ||
serial = $true | ||
} | ||
}, | ||
'RunHelpOut', | ||
@{ | ||
name = 'GitLogger' | ||
uses = 'GitLogging/GitLoggerAction@main' | ||
id = 'GitLogger' | ||
}, | ||
@{ | ||
'name'='Log in to ghcr.io' | ||
'uses'='docker/login-action@master' | ||
'with'=@{ | ||
'registry'='${{ env.REGISTRY }}' | ||
'username'='${{ github.actor }}' | ||
'password'='${{ secrets.GITHUB_TOKEN }}' | ||
} | ||
}, | ||
@{ | ||
name = 'Extract Docker Metadata (for branch)' | ||
if = '${{github.ref_name != ''main'' && github.ref_name != ''master'' && github.ref_name != ''latest''}}' | ||
id = 'meta' | ||
uses = 'docker/metadata-action@master' | ||
with = @{ | ||
'images'='${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}' | ||
} | ||
}, | ||
@{ | ||
name = 'Extract Docker Metadata (for main)' | ||
if = '${{github.ref_name == ''main'' || github.ref_name == ''master'' || github.ref_name == ''latest''}}' | ||
id = 'metaMain' | ||
uses = 'docker/metadata-action@master' | ||
with = @{ | ||
'images'='${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}' | ||
'flavor'='latest=true' | ||
} | ||
}, | ||
@{ | ||
name = 'Build and push Docker image (from main)' | ||
if = '${{github.ref_name == ''main'' || github.ref_name == ''master'' || github.ref_name == ''latest''}}' | ||
uses = 'docker/build-push-action@master' | ||
with = @{ | ||
'context'='.' | ||
'push'='true' | ||
'tags'='${{ steps.metaMain.outputs.tags }}' | ||
'labels'='${{ steps.metaMain.outputs.labels }}' | ||
} | ||
}, | ||
@{ | ||
name = 'Build and push Docker image (from branch)' | ||
if = '${{github.ref_name != ''main'' && github.ref_name != ''master'' && github.ref_name != ''latest''}}' | ||
uses = 'docker/build-push-action@master' | ||
with = @{ | ||
'context'='.' | ||
'push'='true' | ||
'tags'='${{ steps.meta.outputs.tags }}' | ||
'labels'='${{ steps.meta.outputs.labels }}' | ||
} | ||
} | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM mcr.microsoft.com/powershell | ||
|
||
# Set the module name to the name of the module we are building | ||
ARG ModuleName=4bitcss | ||
# Copy the module into the container | ||
COPY . ./usr/local/share/powershell/Modules/$ModuleName | ||
# Create a profile that imports the module, so it is available when the container starts. | ||
RUN pwsh -c "New-Item -Path \$Profile -ItemType File -Force | Out-Null" | ||
RUN pwsh -c "Add-Content -Path \$Profile -Value 'Import-Module $ModuleName' -Force" |