Added docs container
This commit is contained in:
		
							
								
								
									
										46
									
								
								.github/workflows/build.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										46
									
								
								.github/workflows/build.yaml
									
									
									
									
										vendored
									
									
								
							@@ -48,3 +48,49 @@ jobs:
 | 
			
		||||
          uses: ztimson/actions/tag@develop
 | 
			
		||||
          with:
 | 
			
		||||
            tag: ${{env.VERSION}}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  docs:
 | 
			
		||||
    name: Publish Documentation
 | 
			
		||||
    needs: build
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    container: docker
 | 
			
		||||
    steps:
 | 
			
		||||
      -   name: Clone Repository
 | 
			
		||||
          uses: ztimson/actions/clone@develop
 | 
			
		||||
 | 
			
		||||
      -   name: Get Version Number
 | 
			
		||||
          shell: sh
 | 
			
		||||
          run: |
 | 
			
		||||
            [[ -f server/package.json ]] && echo "VERSION=$(cat server/package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+')" >> $GITHUB_ENV
 | 
			
		||||
 | 
			
		||||
      -   name: Push with branch tag
 | 
			
		||||
          uses: ztimson/actions/docker/push@develop
 | 
			
		||||
          with:
 | 
			
		||||
            registry: ${{github.server_url}}
 | 
			
		||||
            user: ${{github.repository_owner}}
 | 
			
		||||
            pass: ${{secrets.DEPLOY_TOKEN}}
 | 
			
		||||
            name: ${{github.repository}}
 | 
			
		||||
            tag: ${{github.ref_name}}
 | 
			
		||||
 | 
			
		||||
      -   name: Push with version tag
 | 
			
		||||
          uses: ztimson/actions/docker/push@develop
 | 
			
		||||
          if: ${{env.VERSION}}
 | 
			
		||||
          with:
 | 
			
		||||
            from: "${{github.server_url}}/${{github.repository}}:${{github.ref_name}}"
 | 
			
		||||
            registry: ${{github.server_url}}
 | 
			
		||||
            user: ${{github.repository_owner}}
 | 
			
		||||
            pass: ${{secrets.DEPLOY_TOKEN}}
 | 
			
		||||
            name: ${{github.repository}}
 | 
			
		||||
            tag: ${{env.VERSION}}
 | 
			
		||||
 | 
			
		||||
      -   name: Push with latest tag
 | 
			
		||||
          uses: ztimson/actions/docker/push@develop
 | 
			
		||||
          if: ${{github.ref_name}} == (git symbolic-ref refs/remotes/origin/HEAD --short | cut -c 7)
 | 
			
		||||
          with:
 | 
			
		||||
            from: "${{github.server_url}}/${{github.repository}}:${{github.ref_name}}"
 | 
			
		||||
            registry: ${{github.server_url}}
 | 
			
		||||
            user: ${{github.repository_owner}}
 | 
			
		||||
            pass: ${{secrets.DEPLOY_TOKEN}}
 | 
			
		||||
            name: ${{github.repository}}
 | 
			
		||||
            tag: latest
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
# Build application
 | 
			
		||||
FROM node:alpine as build
 | 
			
		||||
 | 
			
		||||
RUN mkdir /app
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
COPY . .
 | 
			
		||||
RUN if [ ! -d "docs" ]; then npm install && npm run docs; fi
 | 
			
		||||
 | 
			
		||||
# Use Nginx to serve
 | 
			
		||||
FROM nginx:1.23-alpine
 | 
			
		||||
 | 
			
		||||
COPY --from=build /app/docs /usr/share/nginx/html
 | 
			
		||||
@@ -21,7 +21,7 @@
 | 
			
		||||
	},
 | 
			
		||||
	"scripts": {
 | 
			
		||||
		"build": "npx tsc && npx vite build",
 | 
			
		||||
		"docs": "typedoc --plugin typedoc-plugin-markdown --cleanOutputDir false --outputFileStrategy modules --hidePageHeader --out ./docs --entryPoints src/**/*.ts --readme none --entryFileName Home",
 | 
			
		||||
		"docs": "typedoc --cleanOutputDir false --out ./docs --entryPoints src/**/*.ts --readme none",
 | 
			
		||||
		"test": "npx jest",
 | 
			
		||||
		"test:coverage": "npx jest --coverage",
 | 
			
		||||
		"watch": "npx vite build --watch"
 | 
			
		||||
@@ -32,7 +32,6 @@
 | 
			
		||||
		"jest-junit": "^16.0.0",
 | 
			
		||||
		"ts-jest": "^29.1.2",
 | 
			
		||||
		"typedoc": "^0.26.7",
 | 
			
		||||
		"typedoc-plugin-markdown": "^4.2.7",
 | 
			
		||||
		"typescript": "^5.3.3",
 | 
			
		||||
		"vite": "^5.0.12",
 | 
			
		||||
		"vite-plugin-dts": "^3.7.2"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user