Skip to content

Commit

Permalink
feat: added docker image release workflow; moved Dockerfile to root f…
Browse files Browse the repository at this point in the history
…or Github Actions to fetch it
  • Loading branch information
arnabghose997 committed Nov 24, 2023
1 parent be3e23a commit 8b336cb
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
./server/node_modules
npm-debug.log
./server/package-lock.json
63 changes: 60 additions & 3 deletions .github/workflows/release-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Studio Server Release Workflow
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]-rc.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]-rc.[0-9]+"

permissions:
contents: write
packages: write

jobs:
release-github:
release-binaries-github:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -24,3 +24,60 @@ jobs:
with:
prerelease: false
generate_release_notes: true

publish-docker:
name: Publish Docker Image (linux/amd64)
runs-on: ubuntu-latest
needs: release-binaries-github
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set Latest Tag
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
with:
version: latest

- name: Docker Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare Docker Metadata
id: docker-build
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository}}
flavor: |
latest=auto
tags: |
type=semver,pattern={{version}},value=${{ env.LATEST_RELEASE_TAG }}
labels: |
org.opencontainers.image.vendor="Hypermine Limited"
org.opencontainers.image.title="Entity Studio Dashboard"
org.opencontainers.image.source="https://github.com/hypersign-protocol/entity-studio-dashboard-service"
- name: Build and push image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.docker-build.outputs.tags }}
labels: ${{ steps.docker-build.outputs.labels }}
8 changes: 1 addition & 7 deletions server/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
FROM node:16
WORKDIR /usr/src/app
COPY ./package.json .
COPY ./tsconfig.json .
COPY . .
ADD ./server/ /usr/src/app/
RUN npm cache clean --force
RUN npm install
CMD ["npm","run", "dev"]




2 changes: 0 additions & 2 deletions server/.dockerignore

This file was deleted.

0 comments on commit 8b336cb

Please sign in to comment.