feat: XYN-193 Calling history page (#1103) #207
This file contains hidden or 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: version-release-build-push | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # semantic-release still needs these | |
issues: write | |
pull-requests: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # semantic-release needs full history + tags | |
persist-credentials: false | |
- name: Set up Bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
working-directory: ./server | |
run: bun install | |
- name: Run semantic-release | |
working-directory: ./server | |
env: | |
HUSKY: 0 | |
GITHUB_TOKEN: ${{ secrets.XYNE_GH_TOKEN }} | |
GH_TOKEN: ${{ secrets.XYNE_GH_TOKEN }} | |
run: bunx semantic-release --no-ci | |
- name: Check if new release was published | |
id: check_release | |
run: | | |
# Fetch tags from origin to ensure we see tags created by semantic-release | |
git fetch --tags origin | |
# Get the latest tag reachable from HEAD | |
TAG=$(git describe --tags --exact-match HEAD 2>/dev/null || echo "") | |
if [ -n "$TAG" ]; then | |
echo "published=true" >> $GITHUB_OUTPUT | |
echo "New release tag found: $TAG" | |
else | |
echo "published=false" >> $GITHUB_OUTPUT | |
echo "No new release tag on HEAD" | |
fi | |
- name: Extract version from package.json | |
id: get_version | |
run: | | |
VERSION=$(jq -r .version ./server/package.json) | |
echo "Extracted version: $VERSION" | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Log in to Docker Hub | |
if: steps.check_release.outputs.published == 'true' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.XYNE_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.XYNE_DOCKERHUB_TOKEN }} | |
- name: Build and push Docker image | |
if: steps.check_release.outputs.published == 'true' | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: | | |
xynehq/xyne:latest | |
xynehq/xyne:${{ steps.get_version.outputs.version }} |