Skip to content

Commit

Permalink
Suite tagging (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-c4t authored Sep 18, 2023
1 parent a642ade commit aca6a77
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,38 @@ jobs:
gcloud auth configure-docker --quiet europe-west3-docker.pkg.dev
docker push ${{ steps.setDefaults.outputs.docker_image }}
gcloud run deploy camino-suite-${{ steps.setDefaults.outputs.build_env }} --image ${{ steps.setDefaults.outputs.docker_image }} --region=europe-west1
- name: checkout camino-suite
if: ${{ (github.event_name == 'push') && (steps.setDefaults.outputs.build_env == 'stage') }}
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
repository: 'chain4travel/camino-suite'
ref: 'refs/heads/suite-c4t'
path: './camino-suite'
token: '${{ secrets.GIT_TAGS_TOKEN }}'

- name: Create suite tag
id: createTag
if: ${{ (github.event_name == 'push') && (steps.setDefaults.outputs.build_env == 'stage') }}
run: |
echo "create_tag=false" >> $GITHUB_OUTPUT
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
CURRENT_TAG=$(git describe --abbrev=0 --tags)
if [[ $CURRENT_TAG == *"-rc"* ]]; then
TAG=$(echo "$CURRENT_TAG"|awk -F'-rc' -v OFS='-rc' '{$2=sprintf("%1d",++$2)}7')
git tag -a $TAG -m "create tag $TAG for staging"
git push --tags
echo "create_tag=true" >> $GITHUB_OUTPUT
echo "suite_tag=$TAG" >> $GITHUB_OUTPUT
fi
- name: Create tag
if: ${{ (github.event_name == 'push') && (steps.setDefaults.outputs.build_env == 'stage') && (steps.createTag.outputs.create_tag == 'true') }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag ${{ steps.createTag.outputs.suite_tag }}
git push --tags

0 comments on commit aca6a77

Please sign in to comment.