-
Notifications
You must be signed in to change notification settings - Fork 2
Nodejs static page #44
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
Open
pasibun
wants to merge
16
commits into
main
Choose a base branch
from
nodejs-static-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e4f8d40
Refactor documentation generation: remove index.php, add Node.js scri…
pasibun 834013d
Add serve dependency and start script to package.json
pasibun c8537be
Update README.md: remove redundant comment from npm install command
pasibun aac988f
Update deployment workflow and HTML templates for improved image hand…
pasibun f4ab93e
Enhance deployment workflow: validate container registry variable and…
pasibun dc5c036
Update .github/workflows/deploy.yml
pasibun 65521f9
Update .dockerignore
pasibun a8fc64d
Update package.json
pasibun 66fa8ca
Update Dockerfile
pasibun 50bca16
feat: restructure project for improved serving and styling
pasibun cfec60e
Merge branch 'main' into nodejs-static-page
pasibun c73d6e2
Update package.json
pasibun 3e3a22b
Refactor start script and enhance serve config generation
pasibun 2914efb
fix: add '.WELL-KNOWN' to the ignore list in generate-index.js
pasibun 845f20a
fix: update container registry reference and simplify Slack upload st…
pasibun 4bd9e4d
fix: enhance Slack upload step with error reporting and job failure h…
pasibun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .git | ||
| .github | ||
| node_modules | ||
| npm-debug.log | ||
| .DS_Store | ||
| img | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,73 +1,43 @@ | ||
| name: Deploy Static Docs | ||
| name: Build & Deploy Static Docs | ||
|
pasibun marked this conversation as resolved.
Outdated
|
||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| types: | ||
| - closed | ||
| push: | ||
| branches: | ||
| - develop | ||
| - main | ||
|
pasibun marked this conversation as resolved.
|
||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: '0 6 1 * *' | ||
|
|
||
| jobs: | ||
| deploy: | ||
| name: Deploy `/docs` via SCP | ||
| runs-on: ubuntu-22.04 | ||
|
|
||
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | ||
| env: | ||
| AZURE_CONTAINER_REGISTRY: geonovumregistrytest.azurecr.io | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test registry? fixen voor merge gok ik |
||
| WEB_IMAGE_NAME: geonovumregistrytest.azurecr.io/docs-geostandaarden | ||
|
|
||
| env: | ||
| SSH_PRIVATE_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | ||
| SSH_HOST: ${{ secrets.SSH_HOST }} | ||
| SSH_USER: ${{ secrets.SSH_USER }} | ||
| jobs: | ||
| build-and-push-web: | ||
| name: Build & Push Web Image | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name != 'schedule' | ||
|
|
||
| steps: | ||
| - name: Checkout repo | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # - name: Set up Node.js | ||
| # uses: actions/setup-node@v4 | ||
| # with: | ||
| # node-version: 23 | ||
| # | ||
| # - name: Run build script | ||
| # run: node build.js | ||
|
|
||
| - name: Setup SSH key | ||
| run: | | ||
| mkdir -p ~/.ssh | ||
| echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa | ||
| chmod 600 ~/.ssh/id_rsa | ||
| ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts | ||
|
|
||
| - name: Set target path based on branch | ||
| id: path | ||
| run: | | ||
| if [[ "${GITHUB_REF##*/}" == "main" ]]; then | ||
| echo "dir=${{ secrets.SSH_TARGET_DIR_PROD }}" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "dir=${{ secrets.SSH_TARGET_DIR_DEV }}" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Copy `.` via rsync | ||
| run: | | ||
| rsync -avz \ | ||
| --partial \ | ||
| --delete \ | ||
| --exclude='.git/' \ | ||
| --exclude='.github/' \ | ||
| --exclude='.gitignore' \ | ||
| --exclude='.gitattributes' \ | ||
| --exclude='.DS_Store' \ | ||
| --exclude='img/' \ | ||
| --exclude='README.md/' \ | ||
| -e "ssh -i ~/.ssh/id_rsa" \ | ||
| . \ | ||
| "${SSH_USER}@${SSH_HOST}:${{ steps.path.outputs.dir }}/" | ||
| - name: Login to ACR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.AZURE_CONTAINER_REGISTRY }} | ||
| username: ${{ secrets.ACR_USERNAME }} | ||
| password: ${{ secrets.ACR_PASSWORD }} | ||
|
|
||
| - name: Build & push container image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ./Dockerfile | ||
| push: true | ||
| tags: | | ||
| ${{ env.WEB_IMAGE_NAME }}:latest | ||
| ${{ env.WEB_IMAGE_NAME }}:${{ github.sha }} | ||
|
|
||
| monthly_linkcheck: | ||
| name: Monthly Linkchecker Report | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Build stage: install dependencies and generate the landing page | ||
| FROM node:20-alpine AS builder | ||
| WORKDIR /app | ||
|
|
||
| COPY package*.json ./ | ||
| COPY scripts ./scripts | ||
| COPY pubDomainList.json ./ | ||
| COPY . . | ||
|
|
||
| RUN npm ci | ||
|
pasibun marked this conversation as resolved.
Outdated
|
||
| RUN npm run generate:index | ||
|
|
||
| # Runtime stage: serve the static site | ||
| FROM node:20-alpine | ||
| WORKDIR /usr/src/app | ||
|
|
||
| COPY --from=builder /app /usr/src/app | ||
| ENV PORT=8080 | ||
| EXPOSE 8080 | ||
|
|
||
| CMD ["npm", "run", "start"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.