onepanel/.github/workflows/push_dev_branch.yaml

42 lines
1.1 KiB
YAML

name: Publish dev docker image
on:
push:
paths-ignore:
- LICENSE
- ".github/**"
- "*.md"
branches:
- master
jobs:
test-code-job:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.3
env:
POSTGRES_DB: onepanel
POSTGRES_USER: admin
POSTGRES_PASSWORD: tester
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@master
- name: Run testing code
uses: cedrickring/golang-action@1.5.2
with:
args: go test github.com/onepanelio/core/pkg -db=postgres
build:
needs: test-code-job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: onepanel/core
tags: "latest"
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}