-
-
Notifications
You must be signed in to change notification settings - Fork 5
65 lines (53 loc) · 1.45 KB
/
build-push-fe-docker-hub.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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