Skip to content

Commit 02828ff

Browse files
authored
Fix pull request CI/CD, remove secret from Dockerfile (#42)
* test build * try cache * use npm secret * use NEXT_PUBLIC_BASE_PATH * remove secret from dockerfile * remove test build
1 parent e57e56d commit 02828ff

File tree

4 files changed

+3
-20
lines changed

4 files changed

+3
-20
lines changed

.github/workflows/ci-cd-production.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131
context: . # required to respect .dockerignore
3232
cache-from: type=registry,ref=${{ env.BASE_IMAGE }}:latest
3333
cache-to: type=inline
34-
secrets: npmrc=//registry.npmjs.org/:_authToken=${{ secrets.NPM_SECRET_TOKEN }}
3534
tags: |
3635
${{ env.BASE_IMAGE }}:${{ github.sha }}
3736
${{ env.BASE_IMAGE }}:latest

.github/workflows/ci-cd-pull-request.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on: pull_request
44

55
env:
66
BASE_IMAGE: ghcr.io/graphprotocol/graph-docs-staging
7-
HEALTH_CHECK_URL: https://staging.thegraph.com/docs
8-
APP_NAME: graph-docs
97
NEXT_PUBLIC_BASE_PATH: /docs
108

119
jobs:
@@ -15,22 +13,10 @@ jobs:
1513
- name: Checkout the repo
1614
uses: actions/checkout@v2
1715

18-
- name: Login to GitHub Container Registry
19-
uses: docker/login-action@v1
20-
with:
21-
registry: ghcr.io
22-
username: nenadjaja
23-
password: ${{ secrets.GH_ACCESS_TOKEN }}
24-
25-
- name: Build and push Docker image
16+
- name: Build Docker image
2617
uses: docker/build-push-action@v2
2718
with:
2819
context: . # required to respect .dockerignore
2920
cache-from: type=registry,ref=${{ env.BASE_IMAGE }}:latest
30-
cache-to: type=inline
31-
secrets: npmrc=//registry.npmjs.org/:_authToken=${{ secrets.NPM_SECRET_TOKEN }}
32-
tags: |
33-
${{ env.BASE_IMAGE }}:${{ github.sha }}
34-
${{ env.BASE_IMAGE }}:latest
35-
push: true
21+
push: false
3622
build-args: NEXT_PUBLIC_BASE_PATH=${{ env.NEXT_PUBLIC_BASE_PATH }}

.github/workflows/ci-cd-staging.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131
context: . # required to respect .dockerignore
3232
cache-from: type=registry,ref=${{ env.BASE_IMAGE }}:latest
3333
cache-to: type=inline
34-
secrets: npmrc=//registry.npmjs.org/:_authToken=${{ secrets.NPM_SECRET_TOKEN }}
3534
tags: |
3635
${{ env.BASE_IMAGE }}:${{ github.sha }}
3736
${{ env.BASE_IMAGE }}:latest

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ COPY ./package.json /app/package.json
1111
COPY ./yarn.lock /app/yarn.lock
1212

1313
# install the packages
14-
RUN --mount=type=secret,id=npmrc,dst=/root/.npmrc \
15-
yarn install
14+
RUN yarn install
1615

1716
# copy the rest
1817
COPY . .

0 commit comments

Comments
 (0)