68 lines
2.1 KiB
YAML
68 lines
2.1 KiB
YAML
name: Nightly Release
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * *"
|
|
workflow_dispatch: {}
|
|
jobs:
|
|
test:
|
|
name: Lint and test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.16.x
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt update -qq
|
|
sudo apt install -y -qq build-essential git sqlite libtag1-dev ffmpeg libasound-dev zlib1g-dev
|
|
- name: Lint
|
|
uses: golangci/golangci-lint-action@v2
|
|
with:
|
|
version: v1.42.1
|
|
skip-go-installation: true
|
|
args: --timeout=5m
|
|
- name: Test
|
|
run: go test ./...
|
|
build-release:
|
|
name: Build and release Docker image
|
|
runs-on: ubuntu-latest
|
|
needs: [test]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
with:
|
|
image: tonistiigi/binfmt:latest
|
|
platforms: all
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
with:
|
|
install: true
|
|
version: latest
|
|
driver-opts: image=moby/buildkit:master
|
|
- name: Login into DockerHub
|
|
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
|
|
- name: Login into GitHub Container Registry
|
|
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
|
- name: Generate short hash
|
|
run: |
|
|
_short_hash=${{ github.sha }}
|
|
echo "SHORT_HASH=${_short_hash:0:7}" >> $GITHUB_ENV
|
|
- name: Build and Push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
push: true
|
|
tags: |
|
|
ghcr.io/${{ github.repository }}:${{ env.SHORT_HASH }}
|
|
ghcr.io/${{ github.repository }}:nightly
|
|
${{ github.repository }}:${{ env.SHORT_HASH }}
|
|
${{ github.repository }}:nightly
|