Skip to content

Test

Test #17

Workflow file for this run

name: Test
permissions:
contents: read
id-token: write
on:
workflow_dispatch:
jobs:
build:
name: Test
runs-on: ubuntu-latest
env:
ECR_REPOSITORY: bento-frontend
IMAGE_TAG: build_test
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set Image Tag
run: |
# Get all tags for the repo and find the latest tag for the branch being built
git fetch --tags --force --quiet
tag=$(git tag -l $GITHUB_REF_NAME* | tail -1 | cut -d "-" -f2-)
if [ ! -z "$tag" ];
then
# Increment the build number if a tag is found
build_num=$(echo "${tag##*.}")
build_num=$((build_num+1))
echo 'IMAGE_TAG=$GITHUB_REF_NAME.$build_num' >> $GITHUB_ENV
else
# If no tag is found create a new tag name
build_num=1
echo 'IMAGE_TAG=$GITHUB_REF_NAME.$build_num' >> $GITHUB_ENV
fi
- name: Echo Image Tag
run: |
echo $IMAGE_TAG