exportarr/.github/workflows/ci.yml
2021-03-13 11:45:39 -05:00

59 lines
1.3 KiB
YAML

name: ci
on:
push:
branches:
- master
pull_request:
types:
- opened
- reopened
env:
REGISTRY_IMAGE: ghcr.io/onedr0p/exportarr
jobs:
build:
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, '[ci-skip]')"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
id: prep
run: |
echo ::set-output name=version::${GITHUB_REF##*/}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
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 to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and Push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
${{ env.REGISTRY_IMAGE }}:${{ steps.prep.outputs.version }}