Skip to content

feat(ci): Added script to build and push docker image based on tag #138

feat(ci): Added script to build and push docker image based on tag

feat(ci): Added script to build and push docker image based on tag #138

Workflow file for this run

name: semantic-release-versioning

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 36, Col: 9): 'id' is already defined
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
id: semantic
id: semantic
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: 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
uses: docker/login-action@v3
with:
username: ${{ secrets.XYNE_DOCKERHUB_USERNAME }}
password: ${{ secrets.XYNE_DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
xynehq/staging:latest
xynehq/staging:${{ steps.get_version.outputs.version }}