Skip to content

update Global Tsunami Hazard map service: remove rate fileds, enlarge… #23

update Global Tsunami Hazard map service: remove rate fileds, enlarge…

update Global Tsunami Hazard map service: remove rate fileds, enlarge… #23

name: Publish Frontend Docker Image
on:
push:
branches: [main]
paths:
- "frontend/**"
- ".github/workflows/frontend-image.yml"
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Bump frontend version
run: |
cd frontend
npm install
npm ci
npm version patch --no-git-tag-version
VERSION=$(node -p 'require("./package.json").version')
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
cd ..
- name: Commit version bump
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add frontend/package.json
git commit -m "chore: bump frontend version to $VERSION" && git push || echo "No changes to commit"
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./frontend
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/global-tsunami-risk-map-frontend:latest
ghcr.io/${{ github.repository_owner }}/global-tsunami-risk-map-frontend:${{ env.VERSION }}