diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6ffccf..72fbec5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,9 @@ name: Build on: pull_request: + push: + branches: + - main workflow_dispatch: workflow_call: inputs: @@ -24,22 +27,35 @@ jobs: build: name: Build caddy runs-on: ubuntu-latest - permissions: {} + permissions: + contents: read steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + with: + path: caddy-umami + - name: Install Go uses: actions/setup-go@v5 with: go-version: ${{ inputs.go || '~1.22.1' }} - - name: Build Caddy + - name: Install xcaddy run: | wget https://github.com/caddyserver/xcaddy/releases/download/v${{ env.XCADDY_VERSION }}/xcaddy_${{ env.XCADDY_VERSION }}_linux_amd64.tar.gz tar -xzvf xcaddy_${{ env.XCADDY_VERSION }}_linux_amd64.tar.gz + + - name: Build Caddy + run: | GOOS=$GOOS GOARCH=$GOARCH ./xcaddy build \ - --with github.com/${{ github.repository }}@${{ github.ref_name}} \ + --with github.com/jonaharagon/caddy-umami=./caddy-umami \ --with github.com/caddyserver/cache-handler \ --with github.com/digilolnet/caddy-bunny-ip \ --output "caddy-$GOOS-$GOARCH" + + - name: Show build info + run: | + ./caddy-$GOOS-$GOARCH build-info - name: Upload artifact uses: actions/upload-artifact@v4