Skip to content

feat: versioning

feat: versioning #13

name: Build, Push, and Release
on:
push:
branches:
- ft/versioning
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./Website/ui
file: ./Website/ui/Dockerfile
platforms: linux/amd64
push: true
tags: enaccess/mpm-frontend:latest
release:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
working-directory: ./
run: npm install
- name: Check if tag exists
id: check_tag
run: |
git fetch --tags
if git rev-parse "v1.0.0" >/dev/null 2>&1; then
echo "Tag v1.0.0 already exists"
echo "TAG_EXISTS=true" >> $GITHUB_ENV
else
echo "TAG_EXISTS=false" >> $GITHUB_ENV
fi
- name: Run semantic-release
if: env.TAG_EXISTS == 'false'
working-directory: ./
run: npx semantic-release