From f65f157230920370bea03abc1a9c1f0170ec667c Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Fri, 3 Jul 2020 00:42:23 +0800 Subject: [PATCH] Fix workflow conditions --- .github/workflows/docker.yml | 10 +++++----- 2.1/alpine/Dockerfile | 37 ------------------------------------ update.go | 4 ++++ 3 files changed, 9 insertions(+), 42 deletions(-) delete mode 100644 2.1/alpine/Dockerfile diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 26c88fa..e3f2bdf 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -34,7 +34,7 @@ jobs: go run update.go -dockerfiles - name: Commit and push changes - id: commit_dockerfiles + id: commit-dockerfiles run: | git add */*/Dockerfile if output=$(git status --porcelain) && [ ! -z "$output" ]; then @@ -44,21 +44,21 @@ jobs: fi - name: Regenerate Bashbrew manifests - if: steps.commit_dockerfiles.bumped == 'yes' + if: steps.commit-dockerfiles.outputs.bumped == 'yes' run: | go run update.go -manifest -commit $(git log -1 --format='format:%H' HEAD) - name: Build on Linux - if: steps.commit_dockerfiles.bumped == 'yes' + if: steps.commit-dockerfiles.outputs.bumped == 'yes' run: | bashbrew build --pull always caddy - name: push - if: steps.commit_dockerfiles.bumped == 'yes' + if: steps.commit-dockerfiles.outputs.bumped == 'yes' run: | echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin bashbrew push caddy - name: microbadger - if: steps.commit_dockerfiles.bumped == 'yes' + if: steps.commit-dockerfiles.outputs.bumped == 'yes' run: curl -X POST https://hooks.microbadger.com/images/productionwentdown/caddy/OVgee2in7ldJ7GgTZiScpwH_mTs= diff --git a/2.1/alpine/Dockerfile b/2.1/alpine/Dockerfile deleted file mode 100644 index fe8086c..0000000 --- a/2.1/alpine/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM caddy:2.1.1-alpine as build - -RUN apk add --no-cache upx ca-certificates \ - && upx --ultra-brute /usr/bin/caddy \ - && caddy version - -FROM scratch - -COPY --from=build /etc/caddy/Caddyfile /etc/caddy/Caddyfile -COPY --from=build /usr/share/caddy/index.html /usr/share/caddy/index.html -COPY --from=build /usr/bin/caddy /usr/bin/caddy -COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=build /etc/nsswitch.conf /etc/nsswitch.conf - -ENV XDG_CONFIG_HOME=/config -ENV XDG_DATA_HOME=/data -ENV HOME=/ - -VOLUME /config -VOLUME /data - -LABEL org.opencontainers.image.version=v2.1.1 -LABEL org.opencontainers.image.title="Caddy (productionwentdown build)" -LABEL org.opencontainers.image.description="a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go" -LABEL org.opencontainers.image.url=https://productionwentdown.makerforce.io -LABEL org.opencontainers.image.documentation=https://caddyserver.com/docs -LABEL org.opencontainers.image.vendor="productionwentdown" -LABEL org.opencontainers.image.licenses=Apache-2.0 -LABEL org.opencontainers.image.source="https://github.com/productionwentdown/caddy" - -EXPOSE 80 -EXPOSE 443 -EXPOSE 2019 - -WORKDIR /srv - -CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"] diff --git a/update.go b/update.go index c16163c..3c1eb28 100644 --- a/update.go +++ b/update.go @@ -165,5 +165,9 @@ func updateManifest(man *manifest.Manifest2822, gitCommit string) error { entry.GitCommit = gitCommit } manifestPath := path.Join("library", "caddy") + err := os.MkdirAll("library", 0755) + if err != nil { + return err + } return ioutil.WriteFile(manifestPath, []byte(man.String()), 0644) }