26 lines
858 B
YAML
26 lines
858 B
YAML
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- labeled
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-docker-image:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./watchdog-go
|
|
if: |
|
|
((github.event.action == 'labeled') &&
|
|
(github.event.label.name == 'watchdog-go')) ||
|
|
((github.event.action == 'synchronize') &&
|
|
contains(github.event.pull_request.labels.*.name, 'watchdog-go') ||
|
|
(github.event.action == 'workflow_dispatch')
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- run: docker login -u usbharu -p ${{ secrets.DEPLOY_TOKEN }} git.usbharu.dev
|
|
- run: docker build ./ watchdog-go -t latest -t ${{ github.sha }}
|
|
- run: docker push git.usbharu.dev/usbharu/watchdog-go:${{ github.sha }} |