diff --git a/.drone.yml b/.drone.yml index c4054b9..b355c25 100644 --- a/.drone.yml +++ b/.drone.yml @@ -38,10 +38,22 @@ steps: - name: release image: goreleaser/goreleaser:v0.162.0 + volumes: + - name: dockersock + path: /var/run environment: GITHUB_TOKEN: from_secret: github_token + DOCKER_USERNAME: + from_secret: docker_username + DOCKER_PASSWORD: + from_secret: github_token + DOCKER_REGISTRY: ghcr.io commands: + - sleep 5 + - > + echo $DOCKER_PASSWORD | + docker login $DOCKER_REGISTRY -u $DOCKER_USERNAME --password-stdin - goreleaser release --rm-dist depends_on: - tags @@ -50,3 +62,15 @@ steps: when: event: - tag + +services: + - name: docker + image: docker:dind + privileged: true + volumes: + - name: dockersock + path: /var/run + +volumes: + - name: dockersock + temp: {} diff --git a/.goreleaser.yml b/.goreleaser.yml index 70f866f..92f91c2 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -41,3 +41,12 @@ release: github: owner: xsteadfastx name: schnutibox + +dockers: + - dockerfile: build/package/docker/Dockerfile + goos: linux + goarch: amd64 + image_templates: + - ghcr.io/xsteadfastx/schnutibox:latest + - ghcr.io/xsteadfastx/schnutibox:{{ .Tag }} + - ghcr.io/xsteadfastx/schnutibox:v{{ .Major}} diff --git a/build/package/docker/Dockerfile b/build/package/docker/Dockerfile new file mode 100644 index 0000000..e6a6bdf --- /dev/null +++ b/build/package/docker/Dockerfile @@ -0,0 +1,4 @@ +FROM scratch +COPY schnutibox / +ENTRYPOINT ["/schnutibox"] +CMD ["web"]