From 5ed31019ac76113a8562e264a55013dcc7279287 Mon Sep 17 00:00:00 2001 From: Dylan McReynolds <40469975+dylanmcreynolds@users.noreply.github.com> Date: Tue, 7 Sep 2021 09:19:53 -0700 Subject: [PATCH 1/6] add ghrc.io build and upload --- .github/workflows/image-build-push.yml | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/image-build-push.yml diff --git a/.github/workflows/image-build-push.yml b/.github/workflows/image-build-push.yml new file mode 100644 index 0000000..11dd1c4 --- /dev/null +++ b/.github/workflows/image-build-push.yml @@ -0,0 +1,41 @@ +name: build and deploy + +on: [push, pull_request] + +jobs: + ghcr: + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + name: Build docker image and publish to ghrc.io + needs: [test_build] + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + file: Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From 8577e9fec7589045e9ff191e63077b2c3a949e73 Mon Sep 17 00:00:00 2001 From: Dylan McReynolds <40469975+dylanmcreynolds@users.noreply.github.com> Date: Tue, 7 Sep 2021 09:23:26 -0700 Subject: [PATCH 2/6] move image build into test-build.yml --- .github/workflows/image-build-push.yml | 41 -------------------------- .github/workflows/test-build.yml | 36 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/image-build-push.yml diff --git a/.github/workflows/image-build-push.yml b/.github/workflows/image-build-push.yml deleted file mode 100644 index 11dd1c4..0000000 --- a/.github/workflows/image-build-push.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: build and deploy - -on: [push, pull_request] - -jobs: - ghcr: - env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - name: Build docker image and publish to ghrc.io - needs: [test_build] - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - file: Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index cae31a8..00002c6 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -24,3 +24,39 @@ jobs: cp CI/ESS/local.config.json src/local.config.json npm ci npm run build + ghcr: + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + name: Build docker image and publish to ghrc.io + needs: [test_build] + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + file: Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From 586b178bfa2cf704c5b6a4ebd5b08edbff24787c Mon Sep 17 00:00:00 2001 From: Dylan McReynolds <40469975+dylanmcreynolds@users.noreply.github.com> Date: Tue, 7 Sep 2021 09:43:11 -0700 Subject: [PATCH 3/6] add default local.config.json for build to work --- .gitignore | 1 - src/local.config.json | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/local.config.json diff --git a/.gitignore b/.gitignore index e0f12ab..1d6b1a4 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,5 @@ yarn-debug.log* yarn-error.log* .vscode/launch.json -local.config.json tst diff --git a/src/local.config.json b/src/local.config.json new file mode 100644 index 0000000..499acfe --- /dev/null +++ b/src/local.config.json @@ -0,0 +1,17 @@ +{ + "zipDir": "/tmpZip", + "zipRetentionMillis": 3600000, + "jwtSecret": "123", + "sessionSecret": "456", + "facility": "als", + "dramDirectory": "uploads/", + "testData": { + "jwt": "", + "directory": "", + "files": [ + "", + "", + "" + ] + } + } \ No newline at end of file From 366c33ccffc017d5a5f1cb439b3a37b07169cfc0 Mon Sep 17 00:00:00 2001 From: Dylan McReynolds <40469975+dylanmcreynolds@users.noreply.github.com> Date: Tue, 7 Sep 2021 09:51:08 -0700 Subject: [PATCH 4/6] update npmjs to https --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fa12c6e..e026827 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /home/node/app COPY package*.json /home/node/app/ COPY .snyk /home/node/app/ -RUN npm config set registry http://registry.npmjs.org/ +RUN npm config set registry https://registry.npmjs.org/ RUN npm config set strict-ssl false RUN npm ci --no-cache From 443c17020e53c3b7b1edb115ba63e7f97144f3d9 Mon Sep 17 00:00:00 2001 From: Dylan McReynolds Date: Tue, 7 Sep 2021 11:47:12 -0700 Subject: [PATCH 5/6] change username --- .github/workflows/test-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 00002c6..520fdf7 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -43,7 +43,7 @@ jobs: uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 with: registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} + username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker From c8908dfc1490695ae934097977e95bd4b2311593 Mon Sep 17 00:00:00 2001 From: Dylan McReynolds Date: Tue, 7 Sep 2021 12:00:33 -0700 Subject: [PATCH 6/6] undo change to rigistery user --- .github/workflows/test-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 520fdf7..00002c6 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -43,7 +43,7 @@ jobs: uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 with: registry: ${{ env.REGISTRY }} - username: ${{ github.repository_owner }} + username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker