updates to build container
This commit is contained in:
		
							
								
								
									
										50
									
								
								.gitea/workflows/build-and-publish.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								.gitea/workflows/build-and-publish.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,50 @@ | |||||||
|  |  | ||||||
|  | name: Build and publish container images | ||||||
|  |  | ||||||
|  | on: | ||||||
|  | - workflow_dispatch | ||||||
|  |   # push: | ||||||
|  |   #   branches: | ||||||
|  |   #   - master | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   build-and-publish: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     container: | ||||||
|  |       image: catthehacker/ubuntu:act-latest | ||||||
|  |     steps: | ||||||
|  |     - name: Check out the repo | ||||||
|  |       uses: actions/checkout@v3 | ||||||
|  |  | ||||||
|  |     - name: Set up QEMU | ||||||
|  |       uses: docker/setup-qemu-action@v2 | ||||||
|  |  | ||||||
|  |     - name: Set up Docker Buildx | ||||||
|  |       uses: docker/setup-buildx-action@v2 | ||||||
|  |  | ||||||
|  |     - name: Log in to the Container registry | ||||||
|  |       uses: docker/login-action@v2 | ||||||
|  |       with: | ||||||
|  |         registry: gitea.jbrumond.me | ||||||
|  |         username: ${{ secrets.REGISTRY_USER }} | ||||||
|  |         password: ${{ secrets.REGISTRY_TOKEN }} | ||||||
|  |  | ||||||
|  |     - name: Build Container and publish | ||||||
|  |       uses: docker/build-push-action@v4 | ||||||
|  |       env: | ||||||
|  |         # see <https://docs.gitea.com/usage/actions/comparison#dockerbuild-push-actionv4> | ||||||
|  |         ACTIONS_RUNTIME_TOKEN: '' | ||||||
|  |       with: | ||||||
|  |         context: . | ||||||
|  |         push: true | ||||||
|  |         tags: | | ||||||
|  |           gitea.jbrumond.me/doc-utils/docs-web:latest | ||||||
|  |         platforms: | | ||||||
|  |           linux/amd64 | ||||||
|  |           linux/arm64 | ||||||
|  |         # linux/riscv64 | ||||||
|  |         # linux/arm/v7 | ||||||
|  |         # linux/arm/v6 | ||||||
|  |         build-args: | | ||||||
|  |           DOC_UTILS_VERSION=0.2 | ||||||
|  |           NGINX_VERSION=1.25 | ||||||
| @@ -2,6 +2,7 @@ | |||||||
| name: Build container images | name: Build container images | ||||||
|  |  | ||||||
| on: | on: | ||||||
|  | # - workflow_dispatch | ||||||
|   push: |   push: | ||||||
|     branches: |     branches: | ||||||
|     - master |     - master | ||||||
| @@ -10,13 +11,31 @@ jobs: | |||||||
|   build: |   build: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     container: |     container: | ||||||
|       image: gitea.jbrumond.me/doc-utils/utils:0.2.0 |       image: catthehacker/ubuntu:act-latest | ||||||
|     steps: |     steps: | ||||||
|     - name: Check out the repo |     - name: Check out the repo | ||||||
|       uses: actions/checkout@v3 |       uses: actions/checkout@v3 | ||||||
|  |  | ||||||
|     - name: Build docs to webpage |     - name: Set up QEMU | ||||||
|       run: docs2website config.yaml |       uses: docker/setup-qemu-action@v2 | ||||||
|  |  | ||||||
|     - name: List files |     - name: Set up Docker Buildx | ||||||
|       run: ls -l www |       uses: docker/setup-buildx-action@v2 | ||||||
|  |  | ||||||
|  |     - name: Build Container | ||||||
|  |       uses: docker/build-push-action@v4 | ||||||
|  |       env: | ||||||
|  |         # see <https://docs.gitea.com/usage/actions/comparison#dockerbuild-push-actionv4> | ||||||
|  |         ACTIONS_RUNTIME_TOKEN: '' | ||||||
|  |       with: | ||||||
|  |         context: . | ||||||
|  |         push: false | ||||||
|  |         platforms: | | ||||||
|  |           linux/amd64 | ||||||
|  |           linux/arm64 | ||||||
|  |         # linux/riscv64 | ||||||
|  |         # linux/arm/v7 | ||||||
|  |         # linux/arm/v6 | ||||||
|  |         build-args: | | ||||||
|  |           DOC_UTILS_VERSION=0.2 | ||||||
|  |           NGINX_VERSION=1.25 | ||||||
|   | |||||||
							
								
								
									
										18
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -1,9 +1,21 @@ | |||||||
|  |  | ||||||
| FROM nginx | ARG DOC_UTILS_VERSION | ||||||
|  | ARG NGINX_VERSION | ||||||
|  |  | ||||||
|  | FROM gitea.jbrumond.me/doc-utils/utils:${DOC_UTILS_VERSION} AS build_stage | ||||||
|  | WORKDIR /workspace | ||||||
|  |  | ||||||
|  | # build website from source files | ||||||
|  | COPY docs layouts partials config.yaml metadata.json /workspace/ | ||||||
|  | RUN docs2website config.yaml | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | FROM nginx:${NGINX_VERSION} AS deploy_stage | ||||||
| EXPOSE 80 | EXPOSE 80 | ||||||
|  |  | ||||||
| # actual web content | # copy actual web content built above | ||||||
| COPY www/ /usr/share/nginx/html | COPY --from=build_stage /workspace/www/ /usr/share/nginx/html | ||||||
| RUN chmod -R +rX /usr/share/nginx/html | RUN chmod -R +rX /usr/share/nginx/html | ||||||
|  |  | ||||||
| # nginx config files | # nginx config files | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user