diff --git a/.github/workflows/rest-sample.yaml b/.github/workflows/rest-sample.yaml index 71f768375e..fab668b7f9 100644 --- a/.github/workflows/rest-sample.yaml +++ b/.github/workflows/rest-sample.yaml @@ -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_PAT }} | docker login ghcr.io -u ${{ secrets.GITHUB_USER }} --password-stdin + docker push ghcr.io/hyperledger/fabric-rest-sample:latest + working-directory: asset-transfer-basic/rest-api-typescript diff --git a/asset-transfer-basic/rest-api-typescript/dammy.txt b/asset-transfer-basic/rest-api-typescript/dammy.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml deleted file mode 100644 index 0752b33d95..0000000000 --- a/ci/azure-pipelines.yml +++ /dev/null @@ -1,46 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -trigger: - - main - - release-1.4 - - release-2.2 - -variables: - - name: NODE_VER - value: 16.x - - group: credentials - -jobs: - - job: REST_Sample - displayName: REST Server Sample - pool: - vmImage: ubuntu-20.04 - steps: - - task: NodeTool@0 - inputs: - versionSpec: $(NODE_VER) - displayName: Install Node.js - - script: npm install - workingDirectory: asset-transfer-basic/rest-api-typescript - displayName: Install REST Sample Dependencies - - script: npm run build - workingDirectory: asset-transfer-basic/rest-api-typescript - displayName: Build REST Sample Application - - script: npm test - workingDirectory: asset-transfer-basic/rest-api-typescript - displayName: Test REST Sample Application - - script: | - docker build -t ghcr.io/hyperledger/fabric-rest-sample . - workingDirectory: asset-transfer-basic/rest-api-typescript - displayName: Build REST Sample Docker Image - - script: | - echo ${GITHUB_PAT} | docker login ghcr.io -u ${GITHUB_USER} --password-stdin - docker push ghcr.io/hyperledger/fabric-rest-sample:latest - condition: and(succeeded(),eq(variables['Build.Reason'], 'IndividualCI')) - workingDirectory: asset-transfer-basic/rest-api-typescript - displayName: Publish REST Sample Docker Image - env: - GITHUB_USER: $(GITHUB_USER) - GITHUB_PAT: $(GITHUB_PAT) \ No newline at end of file