-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ee9d091
Showing
6 changed files
with
932 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,79 @@ | ||
name: container build and push | ||
|
||
on: | ||
push: | ||
branches: [ "*" ] | ||
tags: [ '*.*.*' ] | ||
pull_request: | ||
branches: [ "*" ] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
EULIX_REGISTRY: ${{ secrets.EULIX_REGISTRY }} | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: [self-hosted, linux, x64] | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Inspect builder | ||
run: | | ||
echo "Name: ${{ steps.buildx.outputs.name }}" | ||
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" | ||
echo "Status: ${{ steps.buildx.outputs.status }}" | ||
echo "Flags: ${{ steps.buildx.outputs.flags }}" | ||
echo "Platforms: ${{ steps.buildx.outputs.platforms }}" | ||
- name: Log into registry ${{ env.REGISTRY }} | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Log into registry ${{ env.EULIX_REGISTRY }} | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.EULIX_REGISTRY }} | ||
username: ${{ secrets.EULIX_REGISTRY_USERNAME }} | ||
password: ${{ secrets.EULIX_REGISTRY_PASSWORD }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v2 | ||
with: | ||
images: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
${{ env.EULIX_REGISTRY }}/${{ env.IMAGE_NAME }} | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
builder: ${{ steps.buildx.outputs.name }} | ||
platforms: linux/amd64,linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
file: Dockerfile |
This file contains 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,31 @@ | ||
FROM alpine:3.12.0 AS base_image | ||
|
||
FROM base_image AS build | ||
|
||
RUN apk add --no-cache curl build-base openssl openssl-dev zlib-dev linux-headers pcre-dev git | ||
RUN mkdir nginx | ||
|
||
RUN git clone https://github.com/ao-space/nginx-vod-module.git | ||
|
||
ARG NGINX_VERSION=1.23.0 | ||
ARG VOD_MODULE_VERSION=d96b61febe06f147f937dde721921f2d2206c6bc | ||
|
||
RUN curl -sL https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz | tar -C /nginx --strip 1 -xz | ||
|
||
WORKDIR /nginx | ||
RUN ./configure --prefix=/usr/local/nginx \ | ||
--add-module=../nginx-vod-module \ | ||
--with-http_ssl_module \ | ||
--with-file-aio \ | ||
--with-threads \ | ||
--with-cc-opt="-O3" | ||
RUN make | ||
RUN make install | ||
RUN rm -rf /usr/local/nginx/html /usr/local/nginx/conf/*.default | ||
|
||
FROM base_image | ||
RUN apk add --no-cache ca-certificates openssl pcre zlib | ||
COPY --from=build /usr/local/nginx /usr/local/nginx | ||
COPY nginx.conf /usr/local/nginx/conf/nginx.conf | ||
ENTRYPOINT ["/usr/local/nginx/sbin/nginx"] | ||
CMD ["-g", "daemon off;"] |
Oops, something went wrong.