updates to build container
Some checks failed
continuous-integration/drone/push Build is failing
Build container images / build (push) Failing after 1m35s

This commit is contained in:
James Brumond 2023-08-18 18:38:37 -07:00
parent 4b4a36b739
commit d36f119365
Signed by: james
GPG Key ID: E8F2FC44BAA3357A
3 changed files with 89 additions and 8 deletions

View 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

View File

@ -2,6 +2,7 @@
name: Build container images
on:
# - workflow_dispatch
push:
branches:
- master
@ -10,13 +11,31 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: gitea.jbrumond.me/doc-utils/utils:0.2.0
image: catthehacker/ubuntu:act-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Build docs to webpage
run: docs2website config.yaml
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: List files
run: ls -l www
- name: Set up Docker Buildx
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

View File

@ -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
# actual web content
COPY www/ /usr/share/nginx/html
# copy actual web content built above
COPY --from=build_stage /workspace/www/ /usr/share/nginx/html
RUN chmod -R +rX /usr/share/nginx/html
# nginx config files