fix(caddy): Update caddy version to v2.7.4. #56
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
name: docker-buildimage-caddy | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- 'docker/caddy/**' | |
- '.github/workflows/docker-buildimage-caddy.yml' | |
jobs: | |
sematic-version: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.semantic.outputs.new_release_version }} | |
caddy_version: v2.7.4 | |
go_build_flags: "-trimpath -ldflags '-w s'" | |
caddy_with: > | |
--with github.com/caddy-dns/cloudflare | |
--with github.com/caddy-dns/route53 | |
--with github.com/caddy-dns/vultr | |
--with github.com/gsmlg-dev/caddy-storage-s3 | |
--with github.com/gsmlg-dev/caddy-admin-ui@main | |
--with github.com/gsmlg-dev/caddy-oauth2 | |
--with github.com/caddyserver/cache-handler | |
--with github.com/caddyserver/replace-response | |
--with github.com/greenpau/caddy-security | |
--with github.com/mholt/caddy-ratelimit | |
--with github.com/mholt/caddy-webdav | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- name: Create package.json | |
run: | | |
cat <<EOF > docker/caddy/package.json | |
{ | |
"name": "caddy" | |
} | |
EOF | |
- name: 🚀 Release | |
uses: cycjimmy/semantic-release-action@v3 | |
id: semantic | |
with: | |
working_directory: docker/caddy | |
extends: | | |
semantic-release-monorepo | |
extra_plugins: | | |
@semantic-release/exec | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GOPRIVATE: github.com/gsmlg-dev/gsmlg-golang | |
build-package: | |
runs-on: ubuntu-latest | |
needs: [ sematic-version ] | |
strategy: | |
matrix: | |
platforms: | |
- os: linux | |
arch: amd64 | |
- os: darwin | |
arch: amd64 | |
- os: freebsd | |
arch: amd64 | |
- os: windows | |
arch: amd64 | |
- os: linux | |
arch: arm64 | |
- os: android | |
arch: arm64 | |
- os: darwin | |
arch: arm64 | |
- os: windows | |
arch: arm64 | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup golang | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21.2' | |
- name: Install xcaddy | |
run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest | |
- name: Configure git for private modules | |
env: | |
USER: ${{ secrets.GIT_USER_ID }} | |
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
run: git config --global url."https://${USER}:${TOKEN}@github.com".insteadOf "https://github.com" | |
- name: Build by xcaddy | |
env: | |
GOOS: ${{ matrix.platforms.os }} | |
GOARCH: ${{ matrix.platforms.arch }} | |
CADDY_VERSION: ${{ needs.sematic-version.outputs.caddy_version }} | |
CADDY_WITH: ${{ needs.sematic-version.outputs.caddy_with }} | |
GOPRIVATE: github.com/gsmlg-dev/gsmlg-golang,gsmlg.dev | |
CGO_ENABLED: "0" | |
# XCADDY_GO_BUILD_FLAGS: ${{ needs.sematic-version.outputs.go_build_flags }} | |
run: | | |
xcaddy build ${CADDY_VERSION} --output "caddy_${GOOS}_${GOARCH}" $CADDY_WITH | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: caddy_${{ matrix.platforms.os }}_${{ matrix.platforms.arch }} | |
asset_name: caddy_${{ matrix.platforms.os }}_${{ matrix.platforms.arch }} | |
tag: caddy-v${{ needs.sematic-version.outputs.version }} | |
build-image: | |
runs-on: ubuntu-latest | |
needs: [ sematic-version ] | |
steps: | |
- | |
name: Checkout | |
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: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_PASSWD }} | |
- | |
name: Build and push | |
id: build | |
uses: docker/build-push-action@v3 | |
with: | |
context: docker/caddy/ | |
file: docker/caddy/Dockerfile | |
platforms: linux/amd64,linux/arm64/v8 | |
push: true | |
build-args: | | |
CADDY_VERSION=${{ needs.sematic-version.outputs.caddy_version }} | |
CADDY_WITH=${{ needs.sematic-version.outputs.caddy_with }} | |
USER=${{ secrets.GIT_USER_ID }} | |
TOKEN=${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
GOPRIVATE=github.com/gsmlg-dev/gsmlg-golang,gsmlg.dev | |
CGO_ENABLED=0 | |
tags: | | |
docker.io/gsmlg/caddy:v${{ needs.sematic-version.outputs.version }} | |
docker.io/gsmlg/caddy:latest | |