This repository was archived by the owner on Feb 26, 2025. It is now read-only.
Build and Release HPC Resource Provisioner #7
Workflow file for this run
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
--- | |
name: Build and Release HPC Resource Provisioner | |
on: | |
workflow_dispatch: | |
inputs: | |
rel_branch: | |
description: Release branch/commit | |
default: main | |
required: true | |
env: | |
REL_BRANCH: ${{ github.event.inputs.rel_branch }} | |
jobs: | |
tag-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: clone repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.REL_BRANCH }} | |
- name: Determine version | |
run: | | |
echo REL_TAG=$(awk '/version =/ {print $3}' hpc_provisioner/pyproject.toml | tr -d '"') >> $GITHUB_ENV | |
- name: Create and upload tag ${{ env.REL_TAG }} | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git tag -a $REL_TAG -m "${REL_TAG}" | |
git push origin $REL_TAG | |
working-directory: ${{runner.workspace}}/hpc-resource-provisioner | |
- name: Build and push container | |
env: | |
BBPBUILDBOT_DOCKERHUB_PASSWORD: ${{ secrets.BBPBUILDBOT_DOCKERHUB_PASSWORD }} | |
run: | | |
SOURCE_CHECKSUM=$(find hpc_provisioner -type f -exec sha256sum {} \; | sha256sum | awk '{print $1}') | |
docker build --label "org.opencontainers.image.checksum=${SOURCE_CHECKSUM}" --label "org.opencontainers.image.software_version=${REL_TAG}" -t hpc-resource-provisioner:${REL_TAG} . | |
docker login -u bbpbuildbot -p "${BBPBUILDBOT_DOCKERHUB_PASSWORD}" | |
docker push bluebrain/hpc-resource-provisioner:${REL_TAG} | |
# docker push hpc-resource-provisioner:${REL_TAG} docker.io/bluebrain/hpc-resource-provisioner:latest | |
working-directory: ${{runner.workspace}}/hpc-resource-provisioner | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ env.REL_TAG }} | |
make_latest: true | |
body: |- | |
Latest container image will always be: `docker pull bluebrain/hpc-resource-provisioner:latest` | |
This particular version is `docker pull bluebrain/hpc-resource-provisioner:${REL_TAG}` |