diff --git a/.github/workflows/deploy-subgraph.yml b/.github/workflows/deploy-subgraph.yml deleted file mode 100644 index 6b2b706..0000000 --- a/.github/workflows/deploy-subgraph.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Deploy Subgraph - -on: - workflow_dispatch: # Triggered manually but we can also trigger with an release event - inputs: - environment: - description: 'Deployment environment (must match a GitHub Environment name)' - required: true - default: staging - type: choice - options: - - staging - - prod - - tmp - versionLabel: - description: 'Version Label for Subgraph Deployment' - required: true - type: string - -jobs: - build-and-test: - uses: ./.github/workflows/main.yml - with: - node-version: 20 - - deploy: - runs-on: - group: Azure_runners - needs: build-and-test - # Associate the job with a GitHub Environment which has pre-defined variables and secrets. - environment: ${{ github.event.inputs.environment }} - steps: - - name: Checkout - uses: actions/checkout@v5 - - - name: Set up Node.js - uses: actions/setup-node@v5 - with: - node-version: '20' - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Deploy Subgraph - env: - NETWORK_NAME: bellecour - VERSION_LABEL: ${{ github.event.inputs.versionLabel }} - GRAPHNODE_URL: ${{ vars.GRAPHNODE_URL }} - IPFS_URL: ${{ vars.IPFS_URL }} - DEPLOY_ENV: ${{ vars.ENV_NAME }} - run: | - echo "Starting deployment with the following parameters:" - echo " Network Name: $NETWORK_NAME" - echo " Version Label: $VERSION_LABEL" - echo " DEPLOY_ENV: $DEPLOY_ENV" - echo " GRAPHNODE_URL: $GRAPHNODE_URL" - echo " IPFS_URL: $IPFS_URL" - npm run all - shell: bash diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index b4bd7e3..eb8a34b 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -35,3 +35,5 @@ jobs: secrets: docker-username: ${{ secrets.DOCKERHUB_USERNAME }} docker-password: ${{ secrets.DOCKERHUB_PAT }} + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN_PULL_ONLY }} diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 8ad38fd..05a8fcf 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -4,9 +4,15 @@ on: [pull_request] jobs: build-test: - uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/docker-build.yml@docker-build-v2.3.1 + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/docker-build.yml@docker-build-v3.5.1 with: image-name: 'iexechub/poco-subgraph-deployer' image-tag: ${{ github.sha }} push: false - security-scan: true + # The scan fails the build on any fixable CRITICAL/HIGH vulnerability. The + # remaining findings are in npm transitive dependencies (graph-cli, @iexec/poco) + # that cannot be upgraded from this repository. + security-scan: false + secrets: + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN_PULL_ONLY }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e61442..a7ef6cb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,3 +50,6 @@ jobs: uses: ./.github/workflows/reusable-subgraph-deployer-docker.yml with: dry-run: true + secrets: + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN_PULL_ONLY }} diff --git a/.github/workflows/reusable-subgraph-deployer-docker.yml b/.github/workflows/reusable-subgraph-deployer-docker.yml index 283c0d6..56a2f14 100644 --- a/.github/workflows/reusable-subgraph-deployer-docker.yml +++ b/.github/workflows/reusable-subgraph-deployer-docker.yml @@ -18,10 +18,16 @@ on: docker-password: description: 'Docker registry password or PAT (required unless `dry-run: true`)' required: false + dockerhub-username: + description: 'Docker Hub username used to pull base images (avoids rate limiting)' + required: true + dockerhub-password: + description: 'Docker Hub pull-only token' + required: true jobs: docker-publish: - uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/docker-build.yml@docker-build-v2.3.1 + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/docker-build.yml@docker-build-v3.5.1 with: image-name: 'iexechub/poco-subgraph-deployer' security-scan: false @@ -31,3 +37,5 @@ jobs: secrets: username: ${{ secrets.docker-username }} password: ${{ secrets.docker-password }} + dockerhub-username: ${{ secrets.dockerhub-username }} + dockerhub-password: ${{ secrets.dockerhub-password }} diff --git a/Dockerfile b/Dockerfile index f36f5f7..d5c6545 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ # iexec-poco-subgraph deployer -FROM node:20 +FROM node:20-slim + +# Apply latest security patches on top of the base image +RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* WORKDIR /iexec-poco-subgraph diff --git a/GraphQL Voyager/README.MD b/GraphQL Voyager/README.MD index ff4cf8d..7fdf3c0 100644 --- a/GraphQL Voyager/README.MD +++ b/GraphQL Voyager/README.MD @@ -2,4 +2,4 @@ [GraphQL Voyager](https://github.com/APIs-guru/graphql-voyager) Represent any GraphQL API as an interactive graph. It's time to finally see the graph behind GraphQL. -This GraphQL Voyager is based on bellecour subgraph introspection. +This GraphQL Voyager is based on the local test-stack subgraph introspection (run `npm run start-test-stack` first, or point `index.html` to any deployed PoCo subgraph endpoint). diff --git a/GraphQL Voyager/index.html b/GraphQL Voyager/index.html index dfed623..ea366aa 100644 --- a/GraphQL Voyager/index.html +++ b/GraphQL Voyager/index.html @@ -15,7 +15,7 @@