build: update and split gh workflows (#88)

This commit is contained in:
Ludvig Lundgren 2022-01-16 15:54:59 +01:00 committed by GitHub
parent 8ff8e6bbb0
commit ca6241e7cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 28 deletions

41
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: docker
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
docker:
name: Build and publish Docker images
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.repository_owner }}
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
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View file

@ -10,6 +10,7 @@ permissions:
jobs:
goreleaser:
name: Build and publish Go binaries
runs-on: ubuntu-latest
steps:
@ -32,7 +33,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17.6
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
@ -42,30 +43,3 @@ jobs:
args: release --rm-dist
env:
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.repository_owner }}
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

@ -32,6 +32,8 @@ RUN make -f Makefile build/ctl
# build runner
FROM alpine:latest
LABEL org.opencontainers.image.source = "https://github.com/autobrr/autobrr"
ENV HOME="/config" \
XDG_CONFIG_HOME="/config" \
XDG_DATA_HOME="/config"