Skip to content

Commit

Permalink
Merge pull request #41 from uclahs-cds/nwiltsie_update_docker_action
Browse files Browse the repository at this point in the history
Update tool-Docker-action to v2.1.0
  • Loading branch information
nwiltsie authored Aug 15, 2024
2 parents 9d7245d + 539cb78 commit fe567b3
Showing 1 changed file with 30 additions and 23 deletions.
53 changes: 30 additions & 23 deletions .github/workflows/docker-build-release.yaml
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

0 comments on commit fe567b3

Please sign in to comment.