Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish to GitHub Image Repo #204

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

.vscode/
local.config.json
.vscode/launch.json

tst
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 17 additions & 0 deletions src/local.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"zipDir": "/tmpZip",
"zipRetentionMillis": 3600000,
"jwtSecret": "123",
"sessionSecret": "456",
"facility": "als",
"dramDirectory": "uploads/",
"testData": {
"jwt": "<jwtToken>",
"directory": "<testFileDirectory>",
"files": [
"<testFileName1>",
"<testFileName2>",
"<testFileName3>"
]
}
}