Skip to content

Commit ec32a39

Browse files
authored
Merge pull request #1 from redmitry/main
generate docker image on tag
2 parents d7d7cf7 + ac89b32 commit ec32a39

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Beacon Network UI Docker Image Build
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v5
23+
24+
- name: Log into the Container registry
25+
uses: docker/login-action@v3
26+
if: github.ref_type == 'tag'
27+
with:
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Extract metadata for the Docker image
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
if: github.ref_type == 'tag'
36+
with:
37+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+
39+
- name: Build and push the Docker image
40+
uses: docker/build-push-action@v5
41+
if: github.ref_type == 'tag'
42+
with:
43+
context: .
44+
file: ./Dockerfile
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ARG NODE_VERSION=20
2+
FROM node:${NODE_VERSION}-alpine
3+
COPY . /app
4+
WORKDIR /app
5+
RUN sh -c "corepack enable && (yarn install --immutable || yarn install --frozen-lockfile)"
6+
EXPOSE 3000
7+
CMD yarn start
8+

0 commit comments

Comments
 (0)