Skip to content

Commit 9aedd47

Browse files
authored
Add workflow to publish frontend image (#29)
1 parent d5d0b89 commit 9aedd47

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Frontend Docker Image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'frontend/**'
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
jobs:
14+
build-and-push:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v3
20+
- name: Log in to GHCR
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
- name: Build and push Docker image
27+
uses: docker/build-push-action@v5
28+
with:
29+
context: ./frontend
30+
push: true
31+
tags: |
32+
ghcr.io/${{ github.repository_owner }}/global-tsunami-risk-map-frontend:latest
33+
ghcr.io/${{ github.repository_owner }}/global-tsunami-risk-map-frontend:${{ github.sha }}
34+

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,9 @@ if you change the path or dataset name.
3131
This repository uses **Black**, **isort**, and **Ruff** for Python code. The frontend is formatted with **Prettier**. Recommended VS Code settings are provided in the `.vscode` folder.
3232
Run `pip install -r requirements-dev.txt` to install Python tooling. Frontend formatting tools can be installed by running `npm install` inside the `frontend` directory.
3333
Use `npm run format` to format frontend code.
34+
35+
## CI/CD
36+
A GitHub Actions workflow builds and publishes the frontend Docker image whenever
37+
changes are pushed to the `frontend/` directory on the `main` branch. The image
38+
is pushed to the GitHub Container Registry under the tag
39+
`global-tsunami-risk-map-frontend`.

0 commit comments

Comments
 (0)