Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 6a90ab9

Browse files
committed
ci: add web build push github action
1 parent c768d74 commit 6a90ab9

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/build-push-web.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build and Push Web Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- development
8+
paths:
9+
- web/**
10+
pull_request:
11+
branches:
12+
- main
13+
- development
14+
workflow_dispatch:
15+
16+
jobs:
17+
push_to_registries:
18+
name: Push Docker image to GHCR
19+
runs-on: ubuntu-latest
20+
permissions:
21+
packages: write
22+
contents: read
23+
steps:
24+
- name: Check out the repo
25+
uses: actions/checkout@v4
26+
27+
- name: Log in to the Container registry
28+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Extract metadata (tags, labels) for Docker
35+
id: meta
36+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
37+
with:
38+
images: |
39+
ghcr.io/${{ github.repository }}/web
40+
41+
- name: Build and push Docker images
42+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
43+
with:
44+
context: ./web
45+
file: ./web/Dockerfile.prod
46+
push: true
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)