From d22dd2fe847897cc84fb07df72ad8d318c3f685f Mon Sep 17 00:00:00 2001 From: Ludvig Lundgren Date: Tue, 2 Nov 2021 20:03:23 +0100 Subject: [PATCH] build: autobrrctl and push to ghcr (#35) --- .github/workflows/release.yml | 29 ++++++++++++++++++++++++++++- Dockerfile | 4 +++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 778a768..323afdf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,4 +41,31 @@ jobs: version: latest args: release --rm-dist env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Get the tag name + run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: | + ghcr.io/autobrr/autobrr:${{ env.TAG }} + ghcr.io/autobrr/autobrr:latest diff --git a/Dockerfile b/Dockerfile index 5d2b37b..fb5602f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,7 @@ ENV GOOS=linux #RUN make -f Makefile build/app RUN go build -o bin/${SERVICE} ./cmd/${SERVICE}/main.go +RUN go build -o bin/autobrrctl ./cmd/autobrrctl/main.go # build runner FROM alpine:latest @@ -41,6 +42,7 @@ WORKDIR /app VOLUME /config COPY --from=app-builder /src/bin/autobrr /usr/local/bin/ +COPY --from=app-builder /src/bin/autobrrctl /usr/local/bin/ ENTRYPOINT ["autobrr", "--config", "/config"] -#CMD ["--config", "/config"] \ No newline at end of file +#CMD ["--config", "/config"]