Skip to content

Commit

Permalink
Merge pull request #6 from DARPA-ASKEM/split_py_rs_from_tr
Browse files Browse the repository at this point in the history
split
  • Loading branch information
bigglesandginger authored Nov 23, 2023
2 parents f96f05a + 1057d6b commit 71dceb3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/publish-py-rs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
# Automatically build Docker images on changes to main and push them to a
# Container Registry using HCL Bake file.

name: Build and Publish
on:
push:
branches: ['main']
tags: ['*']

jobs:
tag-generator:
name: Determine image tag
runs-on: ubuntu-22.04
outputs:
image-tag: ${{ steps.generate.outputs.tag }}
steps:
- name: Generate appropriate tag
id: generate
run: |
if [[ '${{ github.ref_type }}' == 'branch' && '${{ github.ref_name }}' == 'main' ]]; then
TAG=latest
else
SEMVER=$( echo ${{ github.ref_name }} | sed -nre 's/^v[^0-9]*(([0-9]+\.)*[0-9]+(-[a-z]+)?).*/\1/p')
if [[ -n $SEMVER ]]; then
TAG=${SEMVER}
else
TAG=${{ github.ref_name }}
fi
fi
echo "$TAG"
echo "tag=${TAG,,}" >> ${GITHUB_OUTPUT}
- name: Show Generated Tag
run: echo ${{ steps.generate.outputs.tag }}

bake:
needs:
- tag-generator
- make-dockerfile
uses: darpa-askem/.github/.github/workflows/bake-publish.yaml@main
with:
file: 'docker-bake.hcl'
group: 'prod'
registry: 'ghcr.io'
organization: ${{ github.repository_owner }}
tag: ${{ needs.tag-generator.outputs.image-tag }}
secrets:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
uses: darpa-askem/.github/.github/workflows/bake-publish.yaml@main
with:
file: 'docker-bake.hcl'
group: 'prod'
group: 'tr'
registry: 'ghcr.io'
organization: ${{ github.repository_owner }}
tag: ${{ needs.tag-generator.outputs.image-tag }}
Expand Down
6 changes: 5 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ function "check_suffix" {
# ----------------------------------------------------------------------------------------------------------------------

group "prod" {
targets = ["skema-py", "skema-rs", "skema-text-reading"]
targets = ["skema-py", "skema-rs"]
}

group "tr" {
targets = ["skema-text-reading"]
}

group "default" {
Expand Down

0 comments on commit 71dceb3

Please sign in to comment.