-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from uclahs-cds/nwiltsie_update_docker_action
Update tool-Docker-action to v2.1.0
- Loading branch information
Showing
1 changed file
with
30 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,50 @@ | ||
--- | ||
name: Build image | ||
name: Update image in GHCR | ||
|
||
run-name: > | ||
${{ | ||
github.event_name == 'delete' && format( | ||
'Delete `{0}{1}`', | ||
github.event.ref_type == 'branch' && 'branch-' || '', | ||
github.event.ref | ||
) | ||
|| github.ref == 'refs/heads/main' && 'Update `dev`' | ||
|| format( | ||
'Update `{0}{1}`', | ||
!startsWith(github.ref, 'refs/tags') && 'branch-' || '', | ||
github.ref_name | ||
) | ||
}} docker tag | ||
# Only rebuild when changes to the run-nextflow-tests/ folder are pushed to | ||
# main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- nwiltsie-nextflow-regression-action | ||
paths: | ||
- 'run-nextflow-tests/*' | ||
- '.github/workflows/docker-build-release.yaml' | ||
branches-ignore: ['gh-pages'] | ||
tags: ['v*'] | ||
delete: | ||
|
||
jobs: | ||
build-and-push-image: | ||
push-or-delete-image: | ||
runs-on: ubuntu-latest | ||
name: Build and push image | ||
name: Update GitHub Container Registry | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- id: getversion | ||
uses: jbutcher5/[email protected] | ||
- name: Read YAML | ||
id: getversion | ||
uses: mikefarah/[email protected] | ||
with: | ||
file: run-nextflow-tests/docker-metadata.yaml | ||
key-path: '["nextflow_version"]' | ||
|
||
cmd: yq '.nextflow_version' run-nextflow-tests/docker-metadata.yaml | ||
- name: Get date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
|
||
- id: build-push | ||
uses: uclahs-cds/tool-Docker-action/build-release@main | ||
- uses: uclahs-cds/[email protected] | ||
with: | ||
metadata-file: run-nextflow-tests/docker-metadata.yaml | ||
context: run-nextflow-tests | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
custom-tags: | | ||
type=raw,enable=${{github.event_name == 'push'}},value=${{steps.getversion.outputs.data}} | ||
type=raw,enable=${{github.event_name == 'push'}},value=${{steps.getversion.outputs.data}}-${{steps.date.outputs.date}} | ||
type=raw,enable=${{github.event_name == 'push' && github.ref == 'refs/heads/main'}},value=${{steps.getversion.outputs.result}} | ||
type=raw,enable=${{github.event_name == 'push' && github.ref == 'refs/heads/main'}},value=${{steps.getversion.outputs.result}}-${{steps.date.outputs.date}} | ||
# Uncomment if you expect to use non-SemVer release tags | ||
# non-semver-tags: true |