From 8ac9f74d7958d92e2f4204c6768c70f22b8af85b Mon Sep 17 00:00:00 2001 From: vishwas1 Date: Mon, 6 Nov 2023 18:21:09 +0530 Subject: [PATCH 1/8] addded git action --- .github/workflows/build.yml | 25 +++++++++++ .github/workflows/release-docker.yml | 62 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 26 ++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release-docker.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1433ae4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Vault Service Build Workflow + +on: + pull_request: + branches: [develop, master] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout into repo + uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Setup NodeJS + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Install packages + run: npm install + + - name: Build studio-api + run: npm run build diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml new file mode 100644 index 0000000..7ecf39f --- /dev/null +++ b/.github/workflows/release-docker.yml @@ -0,0 +1,62 @@ +name: Vault Service Release Docker Workflow + +on: push + +permissions: + contents: write + packages: write + +jobs: + publish-docker: + name: Publish Docker Image (linux/amd64) + runs-on: ubuntu-latest + 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" + + - 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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b77728c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Vault Service Release Workflow + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]-rc.[0-9]+" + +permissions: + contents: write + packages: write + +jobs: + release-github: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + persist-credentials: false + + - name: Release + uses: softprops/action-gh-release@v1 + with: + prerelease: false + generate_release_notes: true From 4f220e660adb7fe3d99b72b3ca17e6d8c6ad536d Mon Sep 17 00:00:00 2001 From: vishwas1 Date: Mon, 6 Nov 2023 18:23:40 +0530 Subject: [PATCH 2/8] adding docker file --- Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..150e5d9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:16 +WORKDIR /usr/src/app +COPY ./package.json . +COPY ./tsconfig.json . +RUN npm install +COPY . . +CMD ["npm", "start"] + + + + + + From d16e8b08171d3f6062396864f881f7275c1d7fd0 Mon Sep 17 00:00:00 2001 From: vishwas1 Date: Mon, 6 Nov 2023 18:24:18 +0530 Subject: [PATCH 3/8] updated version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1433ae4..ff06675 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: - name: Setup NodeJS uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 16 - name: Install packages run: npm install From 6fac99a7a1597464f8e84a0f35e83ffabd82479f Mon Sep 17 00:00:00 2001 From: vishwas1 Date: Mon, 6 Nov 2023 18:41:17 +0530 Subject: [PATCH 4/8] updated version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 60f9b58..e6dea0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hypersign-vault", - "version": "v1.0.0", + "version": "v1.0.1", "description": "", "author": "", "private": true, From 96c22026cb78f95dcd4f313f6ed9f99012d6741b Mon Sep 17 00:00:00 2001 From: vishwas1 Date: Tue, 7 Nov 2023 12:11:08 +0530 Subject: [PATCH 5/8] adding docker ignore --- .dockerignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..07a4f02 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +Dockerfile +.dockerignore +docker-compose.yml +./node_modules +.env \ No newline at end of file From 279bc83b6cc3e8cbbdef4f55681c5df1292b78f6 Mon Sep 17 00:00:00 2001 From: vishwas1 Date: Wed, 15 Nov 2023 17:42:31 +0530 Subject: [PATCH 6/8] updated dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 150e5d9..e959cbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ COPY ./package.json . COPY ./tsconfig.json . RUN npm install COPY . . -CMD ["npm", "start"] +CMD ["npm", "run", "start:dev"] From 6fa698229d8de4e93fc20cbde4c5ca568e910c4a Mon Sep 17 00:00:00 2001 From: vishwas1 Date: Wed, 15 Nov 2023 18:20:31 +0530 Subject: [PATCH 7/8] update docker platform to linux/arm64 --- .github/workflows/release-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index 7ecf39f..c6a364a 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -56,7 +56,7 @@ jobs: uses: docker/build-push-action@v3 with: context: . - platforms: linux/amd64 + platforms: linux/arm64 push: true tags: ${{ steps.docker-build.outputs.tags }} labels: ${{ steps.docker-build.outputs.labels }} From 6bd82a19bd5e889d4ecf4e921a1a5a9db8cea046 Mon Sep 17 00:00:00 2001 From: Arnab Ghose Date: Tue, 21 Nov 2023 17:21:34 +0530 Subject: [PATCH 8/8] refactor: added docker image publish job inside release.yml --- .github/workflows/release-docker.yml | 62 --------------------------- .github/workflows/release.yml | 63 ++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/release-docker.yml diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml deleted file mode 100644 index c6a364a..0000000 --- a/.github/workflows/release-docker.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Vault Service Release Docker Workflow - -on: push - -permissions: - contents: write - packages: write - -jobs: - publish-docker: - name: Publish Docker Image (linux/amd64) - runs-on: ubuntu-latest - 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" - - - name: Build and push image - uses: docker/build-push-action@v3 - with: - context: . - platforms: linux/arm64 - push: true - tags: ${{ steps.docker-build.outputs.tags }} - labels: ${{ steps.docker-build.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b77728c..ae9858d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,15 +3,15 @@ name: Vault Service 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 @@ -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="Hypersign Data Vault Service" + org.opencontainers.image.source="https://github.com/hypersign-protocol/hypersign-data-vault-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 }}