Skip to content

build(deps-dev): bump axios from 1.18.1 to 1.19.0 in /frontend #243

build(deps-dev): bump axios from 1.18.1 to 1.19.0 in /frontend

build(deps-dev): bump axios from 1.18.1 to 1.19.0 in /frontend #243

Workflow file for this run

name: Build and Push Frontend
on:
push:
branches:
- main
- '**'
paths:
- 'frontend/**'
- '.github/workflows/build-frontend.yml'
workflow_dispatch:
env:
IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/wattbot-ui
jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Log in to Docker Hub
uses: docker/login-action@v4
if: github.actor != 'dependabot[bot]'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Read version
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- name: Build frontend
run: |
cd frontend
npm install
npm run build
npm run lint
cd ..
- name: Copy VERSION into frontend
run: cp VERSION frontend/
- name: Set up Docker Buildx
if: github.actor != 'dependabot[bot]'
uses: docker/setup-buildx-action@v4
- name: Set Docker tag
if: github.actor != 'dependabot[bot]'
id: docker_tag
run: |
if [[ "${GITHUB_REF}" == refs/heads/main ]]; then
echo "tag=edge" >> $GITHUB_OUTPUT
elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
version=${GITHUB_REF#refs/tags/}
echo "tag=${version},latest" >> $GITHUB_OUTPUT
else
branch=$(echo "${GITHUB_REF#refs/heads/}" | tr '/' '-')
echo "tag=branch-${branch}" >> $GITHUB_OUTPUT
fi
- name: Build and push frontend Docker image
uses: docker/build-push-action@v7.3.0
if: github.actor != 'dependabot[bot]'
with:
context: ./frontend
file: frontend/Dockerfile
platforms: linux/arm64,linux/amd64
push: true
tags: ${{ env.IMAGE }}:${{ steps.docker_tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max