code formatting + Invite user button on the profile menu #122
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: Frontend Auto Versioning | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'frontend/**' | |
jobs: | |
versioning: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Calculate new version | |
id: calc_version | |
run: | | |
# Fetch all tags | |
git fetch --tags | |
# Get the latest tag, extract date and serial, and calculate the new version | |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | |
DATE=$(date +%y.%m) | |
if [[ "$LATEST_TAG" == "$DATE"* ]]; then | |
SERIAL=$(( ${LATEST_TAG##*.} + 1 )) | |
else | |
SERIAL=1 | |
fi | |
NEW_VERSION="${DATE}.${SERIAL}" | |
echo "New version: $NEW_VERSION" | |
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV | |
- name: Tag New Version | |
run: | | |
git tag $NEW_VERSION | |
git push origin $NEW_VERSION |