From a7e2f2e92c3c7cb099a66f362fdca232a894d9b2 Mon Sep 17 00:00:00 2001 From: Ksenya Arysheva Date: Tue, 21 Nov 2023 13:19:47 +0700 Subject: [PATCH] Add publish action --- .github/workflows/docker.yml | 24 ++++++++++++++++++++++++ .npmrc | 2 ++ projects/savant-lib/Dockerfile | 8 ++++++++ projects/savant-lib/package.json | 4 ++++ 4 files changed, 38 insertions(+) create mode 100644 .github/workflows/docker.yml create mode 100644 .npmrc create mode 100644 projects/savant-lib/Dockerfile diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..1564998 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,24 @@ +name: Docker Image CI + +on: + push: + branches: [ "github-actions" ] + pull_request: + branches: [ "github-actions" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16' + registry-url: 'https://npm.pkg.github.com' + scope: '@savant' + - name: Build the Docker image + run: docker build . --file projects/savant-lib/Dockerfile --tag savant-image + - name: Publish from image + run: docker run savant-image npm publish + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..b0fb8d5 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +@savant:registry=https://npm.pkg.github.com +//npm.pkg.github.com/:_authToken=${TOKEN} \ No newline at end of file diff --git a/projects/savant-lib/Dockerfile b/projects/savant-lib/Dockerfile new file mode 100644 index 0000000..cd72a3b --- /dev/null +++ b/projects/savant-lib/Dockerfile @@ -0,0 +1,8 @@ +FROM node:18.17.1 +WORKDIR /tmp/savant-lib +COPY package.json package-lock.json /tmp/savant-lib/ +RUN npm install +COPY . /tmp/savant-lib +RUN npm run build:savant-lib + +WORKDIR /tmp/savant-lib/dist/savant-lib diff --git a/projects/savant-lib/package.json b/projects/savant-lib/package.json index 2c4f628..c0dae85 100644 --- a/projects/savant-lib/package.json +++ b/projects/savant-lib/package.json @@ -1,6 +1,10 @@ { "name": "@savant/savant-lib", "version": "0.0.1", + "repository": { + "type": "git", + "url": "https://github.com/insight-platform/SavantMetadataExplorer.git" + }, "exports": { "./theming": { "sass": [