Skip to content

Commit

Permalink
Add publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
Ksenya Arysheva committed Nov 21, 2023
1 parent 5db6310 commit a59968f
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Image CI

on:
push:
branches: [ "github-actions" ]
pull_request:
branches: [ "github-actions" ]

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
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 bash -c "npm config set @savant:registry=https://npm.pkg.github.com; npm config set -- '//npm.pkg.github.com/:_authToken' ${TOKEN}; npm publish"
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@savant:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${TOKEN}
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"name": "savant-metadata-explorer",
"version": "0.0.0",
"repository": {
"type": "git",
"url": "https://github.com/insight-platform/SavantMetadataExplorer.git"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
8 changes: 8 additions & 0 deletions projects/savant-lib/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions projects/savant-lib/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit a59968f

Please sign in to comment.