build: autobrrctl and push to ghcr (#35)

This commit is contained in:
Ludvig Lundgren 2021-11-02 20:03:23 +01:00 committed by GitHub
parent b8d91b0e7a
commit d22dd2fe84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 2 deletions

View file

@ -42,3 +42,30 @@ jobs:
args: release --rm-dist args: release --rm-dist
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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

View file

@ -26,6 +26,7 @@ ENV GOOS=linux
#RUN make -f Makefile build/app #RUN make -f Makefile build/app
RUN go build -o bin/${SERVICE} ./cmd/${SERVICE}/main.go RUN go build -o bin/${SERVICE} ./cmd/${SERVICE}/main.go
RUN go build -o bin/autobrrctl ./cmd/autobrrctl/main.go
# build runner # build runner
FROM alpine:latest FROM alpine:latest
@ -41,6 +42,7 @@ WORKDIR /app
VOLUME /config VOLUME /config
COPY --from=app-builder /src/bin/autobrr /usr/local/bin/ COPY --from=app-builder /src/bin/autobrr /usr/local/bin/
COPY --from=app-builder /src/bin/autobrrctl /usr/local/bin/
ENTRYPOINT ["autobrr", "--config", "/config"] ENTRYPOINT ["autobrr", "--config", "/config"]
#CMD ["--config", "/config"] #CMD ["--config", "/config"]