Skip to content

refactor : pipelines #6

refactor : pipelines

refactor : pipelines #6

name: readly frontend pipeline
on:
push:
branches:
- ci/pipeline
- master
paths:
- frontend/**
- Docker/frontend/**
- 'docker-compose.yml'
- .github/workflows/*-frontend.yml
jobs:
build-image:
name: build image
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: extract project version
id: extract_version
run: |
cd frontend
sudo apt-get install -y jq
echo "VERSION=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT
- name: login to docker hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build and push to docker hub
uses: docker/build-push-action@v5
with:
context: frontend
file: Docker/frontend/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ secrets.DOCKERHUB_USERNAME }}/readly-frontend:${{ steps.extract_version.outputs.VERSION }}, ${{ secrets.DOCKERHUB_USERNAME }}/readly-frontend:latest