diff --git a/.github/workflows/rest-sample.yaml b/.github/workflows/rest-sample.yaml index 0fa84f0e..ef5dbc50 100644 --- a/.github/workflows/rest-sample.yaml +++ b/.github/workflows/rest-sample.yaml @@ -6,6 +6,7 @@ run-name: ${{ github.actor }} is testing the REST Sample env: NODE_VER: 16.x + IMAGE_NAME: ghcr.io/hyperledger/fabric-rest-sample on: workflow_dispatch: @@ -15,7 +16,7 @@ on: branches: [ "foobar" ] jobs: - rest-sample: + test-sample: runs-on: ubuntu-20.04 steps: @@ -40,3 +41,38 @@ jobs: run: npm test working-directory: asset-transfer-basic/rest-api-typescript + docker-image: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha,format=long + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + id: push + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml deleted file mode 100644 index 7bb33b91..00000000 --- a/ci/azure-pipelines.yml +++ /dev/null @@ -1,32 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -trigger: - - main - - release-1.4 - - release-2.2 - -variables: - - name: FABRIC_VERSION - value: 2.4 - - name: GOPATH - value: $(Build.Repository.LocalPath) - - name: GO_BIN - value: $(GOPATH)/bin - - name: GO_VER - value: 1.18.3 - - name: NODE_VER - value: 16.x - - name: PATH - value: $(GOPATH)/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin - - group: credentials - -jobs: - - - job: REST_Sample - displayName: REST Server Sample - pool: - vmImage: ubuntu-20.04 - steps: - - template: templates/asset-transfer-basic/azure-pipelines-rest.yml \ No newline at end of file diff --git a/ci/templates/asset-transfer-basic/azure-pipelines-rest.yml b/ci/templates/asset-transfer-basic/azure-pipelines-rest.yml index 715dcda7..1d5d3fc3 100644 --- a/ci/templates/asset-transfer-basic/azure-pipelines-rest.yml +++ b/ci/templates/asset-transfer-basic/azure-pipelines-rest.yml @@ -9,6 +9,7 @@ steps: 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