-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: add automatic docker container builds
Also: - fix file compression in build workflow - was using xz extension with gzip format - made the installer script a little more robust. It handles gzip assets now - Add some workflow badges to the readme
- Loading branch information
Showing
7 changed files
with
114 additions
and
41 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,39 @@ | ||
name: publish docker | ||
|
||
on: | ||
release: | ||
types: [published] | ||
# Manual trigger of a release | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: "Reason" | ||
required: true | ||
default: "" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
lfs: false | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2.5.0 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2.5.0 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Run the build script | ||
shell: pwsh | ||
run: | | ||
$version = gh release view --json tagName,targetCommitish | ConvertFrom-Json | ||
$version | Write-Output | ||
./build/build_and_push -version $version.tagName -commit $version.targetCommitish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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 |
---|---|---|
@@ -1,27 +1,39 @@ | ||
#!/usr/bin/pwsh | ||
|
||
# builds and pushes a docker file to docker hub | ||
# currently only builds the 'stable' tag, which is applied to whatever version | ||
# is supplied to this script. | ||
# Future work: allow this script to build our 'Weekly' and 'Continuous' lines | ||
# as their own containers. | ||
param( | ||
# Version tag | ||
[Parameter(Mandatory=$true)] | ||
[Parameter(Mandatory = $true)] | ||
[string] | ||
$version | ||
$version, | ||
|
||
$commit | ||
) | ||
. $PSScriptRoot/log.ps1 | ||
|
||
log "Resolving commit '$commit'" | ||
|
||
# get the current git commit | ||
$GIT_COMMIT=git log -1 --format=%H | ||
# this will resolve a name (like master/main) into a hash id | ||
# and will return current commit id if empty reference provided | ||
$commit = git log -1 --format=%H "$commit" | ||
|
||
log "Commit resolved to '$commit'" | ||
|
||
$env:DOCKER_BUILDKIT=1 | ||
|
||
log "Building container" "Building" | ||
|
||
docker build ` | ||
-t qutecoacoustics/audio-analysis:stable ` | ||
-t qutecoacoustics/audio-analysis:latest ` | ||
-t qutecoacoustics/audio-analysis:$version ` | ||
. ` | ||
--build-arg GIT_COMMIT=$GIT_COMMIT ` | ||
--build-arg AP_SOURCE="github" ` | ||
--build-arg AP_VERSION=$version | ||
--build-arg GIT_COMMIT=$commit ` | ||
--build-arg AP_VERSION=$version ` | ||
--build-arg CREATION_DATE=((Get-Date ).ToString("O")) | ||
--secret id=GITHUB_AUTH_TOKEN,env=GITHUB_AUTH_TOKEN | ||
|
||
log "Pushing container" "Pushing" | ||
|
||
docker push qutecoacoustics/audio-analysis:stable |
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