-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
192d850
commit 21fa6c8
Showing
4 changed files
with
44 additions
and
274 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 |
---|---|---|
|
@@ -10,119 +10,23 @@ on: | |
# description: 'Tag for new release, ie 1.1.2 .. 4.0.0, etc. 🛑 DO not include the ⍘v⍘ ' | ||
# required: true | ||
# type: string | ||
|
||
#keep ^ commented out after testing | ||
push: | ||
branches: | ||
- master | ||
- main | ||
paths-ignore: | ||
- README.md | ||
- .old_cicd/* | ||
- .github/* | ||
- .github/workflows/* | ||
- LICENSE | ||
- .gitignore | ||
- .dockerignore | ||
- .githooks | ||
tags-ignore: | ||
- 'v[0-9]+.[0-9]+.*' | ||
# branches: | ||
# - master | ||
# - main | ||
# paths-ignore: | ||
# - README.md | ||
# - .old_cicd/* | ||
# - .github/* | ||
# - .github/workflows/* | ||
# - LICENSE | ||
# - .gitignore | ||
# - .dockerignore | ||
# - .githooks | ||
# tags-ignore: | ||
# - 'v[0-9]+.[0-9]+.*' | ||
jobs: | ||
build-push-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Set short git commit SHA | ||
id: vars | ||
run: | | ||
echo "short_sha=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT | ||
# https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ | ||
|
||
- name: Confirm git commit SHA output | ||
run: echo ${{ steps.vars.outputs.short_sha }} | ||
|
||
# https://github.com/marketplace/actions/git-semantic-version | ||
- name: Semver Check | ||
uses: paulhatch/[email protected] | ||
id: version | ||
with: | ||
# The prefix to use to identify tags | ||
tag_prefix: "v" | ||
# A string which, if present in a git commit, indicates that a change represents a | ||
# major (breaking) change, supports regular expressions wrapped with '/' | ||
major_pattern: "/breaking:|major:/" | ||
# A string which indicates the flags used by the `major_pattern` regular expression. Supported flags: idgs | ||
major_regexp_flags: "ig" | ||
# Same as above except indicating a minor change, supports regular expressions wrapped with '/' | ||
minor_pattern: "/feat:|feature:|minor:/" | ||
# A string which indicates the flags used by the `minor_pattern` regular expression. Supported flags: idgs | ||
minor_regexp_flags: "ig" | ||
# A string to determine the format of the version output | ||
# version_format: "${major}.${minor}.${patch}-prerelease${increment}" | ||
version_format: "${major}.${minor}.${patch}" | ||
search_commit_body: false | ||
|
||
# Docker Buildx is important to caching in the Build And Push Container | ||
# step | ||
# https://github.com/marketplace/actions/build-and-push-docker-images | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
logout: true | ||
|
||
- name: Login to Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: containers.renci.org | ||
username: ${{ secrets.CONTAINERHUB_USERNAME }} | ||
password: ${{ secrets.CONTAINERHUB_TOKEN }} | ||
logout: true | ||
|
||
# Notes on Cache: | ||
# https://docs.docker.com/build/ci/github-actions/examples/#inline-cache | ||
- name: Build Push Container | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
# Push to renci-registry and dockerhub here. | ||
# cache comes from dockerhub. | ||
tags: | | ||
containers.renci.org/${{ github.repository }}:v${{ steps.version.outputs.version }} | ||
containers.renci.org/${{ github.repository }}:latest | ||
containers.renci.org/${{ github.repository }}:${{ steps.vars.outputs.short_sha }} | ||
${{ github.repository }}:v${{ inputs.versionTag }} | ||
${{ github.repository }}:latest | ||
${{ github.repository }}:${{ steps.vars.outputs.short_sha }} | ||
cache-from: type=registry,ref=${{ github.repository }}:buildcache | ||
cache-to: type=registry,ref=${{ github.repository }}:buildcache,mode=max | ||
|
||
#==========================TAG & RELEASE W/ NOTES ========================= | ||
|
||
# This creates a "lightweight" ref tag. | ||
- name: Create Tag for Release | ||
run: | | ||
curl \ | ||
-s --fail -X POST \ | ||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
https://api.github.com/repos/${{ github.repository }}/git/refs \ | ||
-d '{"ref":"refs/tags/v${{ steps.version.outputs.version }}","sha":"${{ github.sha }}"}' | ||
# https://cli.github.com/manual/gh_release_create | ||
- name: Create Release | ||
env: | ||
RELEASE_VERSION: ${{ steps.version.outputs.version }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release create ${{ env.RELEASE_VERSION }} \ | ||
-t "${{ env.RELEASE_VERSION }}" \ | ||
--generate-notes \ | ||
--latest | ||
uses: helxplatform/helx-github-actions/.github/workflows/build-push-release.yml@develop | ||
secrets: inherit |
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