-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
10 changed files
with
78 additions
and
40 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 |
---|---|---|
|
@@ -6,12 +6,23 @@ permissions: | |
contents: read | ||
|
||
jobs: | ||
derivates: | ||
name: Lookup derivates | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
matrix: ${{ env.derivates }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Lookup derivates | ||
run: echo "derivates=$(make _derivates)" >> "$GITHUB_ENV" | ||
build: | ||
name: HTTPS Proxy | ||
runs-on: ubuntu-22.04 | ||
needs: derivates | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
derivate: ${{ fromJSON(needs.derivates.outputs.matrix) }} | ||
platform: [linux/arm64, linux/amd64] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -20,25 +31,26 @@ jobs: | |
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@master | ||
- name: Build HTTPS proxy (${{ matrix.platform }}) | ||
- name: Build HTTPS ${{ matrix.derivate }} proxy (${{ matrix.platform }}) | ||
uses: docker/build-push-action@v6 | ||
with: | ||
file: "Dockerfile" | ||
target: ${{ matrix.derivate }} | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
context: context | ||
platforms: ${{ matrix.platform }} | ||
labels: | | ||
org.opencontainers.image.title=HTTPS proxy | ||
org.opencontainers.image.description=Docker image for HTTPS proxy | ||
org.opencontainers.image.title=HTTPS ${{ matrix.derivate }} proxy | ||
org.opencontainers.image.description=Docker image for HTTPS ${{ matrix.derivate }} proxy | ||
org.opencontainers.image.source=https://github.com/${{ github.repository }} | ||
org.opencontainers.image.version=${{ github.sha }} | ||
org.opencontainers.image.version=${{ matrix.derivate }}-${{ github.sha }} | ||
org.opencontainers.image.revision=${{ github.sha }} | ||
tags: | | ||
ghcr.io/${{ github.repository }}:latest | ||
load: ${{ (matrix.platform == 'linux/amd64') }} | ||
ghcr.io/${{ github.repository }}:${{ matrix.derivate }} | ||
load: ${{ (matrix.platform == 'linux/amd64') && matrix.derivate == 'base' }} | ||
- uses: e1himself/[email protected] | ||
if: ${{ (matrix.platform == 'linux/amd64') }} | ||
if: ${{ (matrix.platform == 'linux/amd64') && matrix.derivate == 'base' }} | ||
- name: Test HTTPS proxy | ||
if: ${{ (matrix.platform == 'linux/amd64') }} | ||
if: ${{ (matrix.platform == 'linux/amd64') && matrix.derivate == 'base' }} | ||
run: | | ||
make test |
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
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
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 |
---|---|---|
@@ -1,18 +1,22 @@ | ||
PLATFORMS=$(shell docker version --format '{{.Server.Os}}/{{.Server.Arch}}') | ||
PLATFORM=$(shell docker version --format '{{.Server.Os}}/{{.Server.Arch}}') | ||
DERIVATIVES=$(shell ls context) | ||
|
||
.DEFAULT_GOAL := build | ||
.DEFAULT_GOAL := all | ||
.PHONY: all build clean help _platforms test | ||
|
||
all: PLATFORMS=linux/amd64,linux/arm64 | ||
all: $(DERIVATIVES) ## Build Docker images for all derivatives | ||
|
||
help: ## Display a list of the public targets | ||
@grep -E -h "^[a-z]+:.*##" $(MAKEFILE_LIST) | sed -e 's/\(.*\):.*## *\(.*\)/\1|\2/' | column -s '|' -t | ||
|
||
_derivates: ## Output platforms as JSON list | ||
@echo $(DERIVATIVES) | jq --compact-output --raw-input 'split(" ") | map(select(. != ""))' | ||
|
||
_platforms: ## Output platforms as JSON list | ||
@echo $(PLATFORMS) | jq --compact-output --raw-input 'split(",") | map(select(. != ""))' | ||
|
||
build: ## Build Docker image for the HTTPS proxy | ||
docker buildx build --platform=$(PLATFORMS) --file Dockerfile --tag ghcr.io/reload/https-proxy:latest --load . | ||
$(DERIVATIVES): Dockerfile context ## Build Docker image for derivative | ||
docker buildx build --target $@ --platform=$(PLATFORM) --file Dockerfile --tag ghcr.io/reload/https-proxy:$@ --load context | ||
|
||
test: | ||
dgoss run -e PROFILE=none ghcr.io/reload/https-proxy:latest | ||
test: base | ||
dgoss run ghcr.io/reload/https-proxy:base |
File renamed without changes.
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
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,5 @@ | ||
listen 443 ssl; | ||
listen [::]:443 ssl; | ||
server_name "${FIRST_VIRTUAL_HOST}"; | ||
ssl_certificate /cert/${FIRST_VIRTUAL_HOST}.crt; | ||
ssl_certificate_key /cert/${FIRST_VIRTUAL_HOST}.key; |
File renamed without changes.
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
This file was deleted.
Oops, something went wrong.