Skip to content

Commit e5cf86f

Browse files
committed
Create publish.yml
1 parent 21494d7 commit e5cf86f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/publish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
branches: [ "prod" ]
6+
7+
jobs:
8+
publish-server:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v3
13+
- name: Set up Node.js
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: '22'
17+
- name: Set IMAGE_VERSION
18+
run: echo "IMAGE_VERSION=$(cd nakar-server && npm run --silent version)" >> $GITHUB_ENV
19+
- name: Log in to GitHub Container Registry
20+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
21+
- name: Build and Push Docker image
22+
run: |
23+
docker build -f nakar-server/Dockerfile -t ghcr.io/thn-graphs/nakar/server:${{ env.IMAGE_VERSION }} .
24+
docker push ghcr.io/thn-graphs/nakar/server:${{ env.IMAGE_VERSION }}

0 commit comments

Comments
 (0)