moth/.github/workflows/build+test.yml

71 lines
1.7 KiB
YAML
Raw Normal View History

name: Build/Test/Push
2020-09-18 14:41:41 -06:00
on:
push:
branches:
- v3
- devel
2020-09-18 15:39:07 -06:00
- main
2020-09-18 14:41:41 -06:00
tags:
- 'v*.*.*'
2020-09-17 18:56:40 -06:00
jobs:
test-mothd:
name: Test mothd
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
2020-09-18 14:41:41 -06:00
go-version: 1.13
2020-09-17 18:56:40 -06:00
- name: Retrieve code
2020-09-18 14:41:41 -06:00
uses: actions/checkout@v2
2020-09-17 18:56:40 -06:00
- name: Test
run: go test ./...
2020-09-18 12:52:04 -06:00
2020-09-18 12:15:11 -06:00
publish:
2020-09-18 14:41:41 -06:00
name: Publish container images
2020-09-18 12:15:11 -06:00
runs-on: ubuntu-latest
steps:
- name: Retrieve code
2020-09-18 14:41:41 -06:00
uses: actions/checkout@v2
2020-09-18 15:38:33 -06:00
- name: Gitlab variables
2020-09-18 14:41:41 -06:00
id: vars
2020-09-18 15:38:33 -06:00
run: build/ci/gitlab-vars
2020-09-18 12:15:11 -06:00
2020-09-18 13:12:54 -06:00
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v1
2020-09-18 12:15:11 -06:00
with:
2020-09-18 16:47:17 -06:00
registry: ghcr.io
2020-09-18 13:12:54 -06:00
username: ${{ github.repository_owner }}
2020-09-18 16:47:17 -06:00
password: ${{ secrets.CR_PAT }}
2020-09-18 13:12:54 -06:00
- name: Login to DockerHub
uses: docker/login-action@v1
2020-09-18 12:15:11 -06:00
with:
username: neale
password: ${{ secrets.DOCKER_TOKEN }}
2020-09-18 13:12:54 -06:00
2020-10-29 12:00:43 -06:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# Currently required, because buildx doesn't support auto-push from docker
- name: Set up builder
uses: docker/setup-buildx-action@v1
id: buildx
2020-09-18 13:12:54 -06:00
- name: Build and push moth image
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
2020-09-18 12:15:11 -06:00
target: moth
2020-09-18 13:12:54 -06:00
file: build/package/Containerfile
2020-09-18 15:55:11 -06:00
push: true
2021-03-02 12:42:43 -07:00
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
2020-09-18 15:47:31 -06:00
tags: |
2020-09-18 15:43:33 -06:00
dirtbags/moth:${{ steps.vars.outputs.tag }}
2020-09-18 16:52:56 -06:00
ghcr.io/dirtbags/moth:${{ steps.vars.outputs.tag }}