Skip to content

Commit

Permalink
Move publishing of REST sample Image from AZP to GHA
Browse files Browse the repository at this point in the history
This patch moves publishing of REST sample image from AZP to GHA.
This was the last job running on AZP.
Also, this patch fixes an error encounterd during the image build.
Publishing of REST sample image is now only executed when pushing to main.

Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
  • Loading branch information
satota2 authored and denyeart committed Sep 28, 2023
1 parent 98f7481 commit bda72ca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 49 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/rest-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,14 @@ jobs:
- name: Test REST Sample Application
run: npm test
working-directory: asset-transfer-basic/rest-api-typescript

- name: Build REST Sample Docker Image
run: docker build -t ghcr.io/hyperledger/fabric-rest-sample .
working-directory: asset-transfer-basic/rest-api-typescript

- name: Publish REST Sample Docker Image
if: github.event_name == 'push' && (github.ref == 'refs/heads/main')
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker push ghcr.io/hyperledger/fabric-rest-sample:latest
working-directory: asset-transfer-basic/rest-api-typescript
6 changes: 3 additions & 3 deletions asset-transfer-basic/rest-api-typescript/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14-alpine3.14 AS build
FROM node:18-alpine3.14 AS build

RUN apk add --no-cache g++ make python3 dumb-init

Expand All @@ -10,14 +10,14 @@ RUN npm ci
RUN npm run build
RUN npm prune --production

FROM node:14-alpine3.14
FROM node:18-alpine3.14
ENV NODE_ENV production
WORKDIR /app

COPY --from=build /usr/bin/dumb-init /usr/bin/dumb-init
COPY --chown=node:node --from=build /app .

EXPOSE 3000
EXPOSE 3000

USER node

Expand Down
46 changes: 0 additions & 46 deletions ci/azure-pipelines.yml

This file was deleted.

0 comments on commit bda72ca

Please sign in to comment.