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 diff --git a/.gitignore b/.gitignore index c2698de..1d6b1a4 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -.vscode/ -local.config.json +.vscode/launch.json tst 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 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