Skip to content

Commit

Permalink
deploy to github registry also
Browse files Browse the repository at this point in the history
  • Loading branch information
jac18281828 committed Dec 12, 2022
1 parent 427f6cf commit 93d1f53
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,23 @@ jobs:
uses: actions/checkout@v3
- name: Docker build, lint and run tests
run: docker build . --file Dockerfile --tag ${{github.event.repository.name}}-${GITHUB_SHA::10}
- name: npm publish
- name: configure npmjs
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
- name: npm publish (npmjs)
run: |
docker run -e NPM_TOKEN=${{ secrets.NPM_TOKEN_AUTOMATION }} -e NODE_AUTH_TOKEN=${{ secrets.NPM_TOKEN_AUTOMATION }} --rm -t ${{github.event.repository.name}}-${GITHUB_SHA::10} npm publish --access public
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
- name: configure github registry
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
- name: npm publish (github)
run: |
docker run -e NPM_TOKEN=${{ secrets.NPM_TOKEN_AUTOMATION }} --rm -t ${{github.event.repository.name}}-${GITHUB_SHA::10} npm publish --access public
docker run -e NPM_TOKEN=${{ secrets.NPM_TOKEN_AUTOMATION }} -e NODE_AUTH_TOKEN=${{ secrets.NPM_TOKEN_AUTOMATION }} --rm -t ${{github.event.repository.name}}-${GITHUB_SHA::10} npm publish --access public
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ ENV NODE_PATH ${NVM_NODE_PATH}/lib/node_modules
ENV PATH ${NVM_NODE_PATH}/bin:$PATH

ENV NPM_TOKEN=${NPM_TOKEN}
# used by github
ENV NODE_AUTH_TOKEN=${NPM_TOKEN}

RUN npm install npm -g
RUN npm install yarn -g
Expand All @@ -41,8 +43,9 @@ USER mr

COPY --chown=mr:mr . .
RUN yarn install
#RUN yarn prettier:check
RUN yarn prettier:check
RUN yarn lint
RUN yarn build
RUN yarn test

CMD yarn test
CMD echo "@momentranks/governance"

0 comments on commit 93d1f53

Please sign in to comment.