unos/.gitea/workflows/watchdog-build.yaml

32 lines
1022 B
YAML
Raw Normal View History

2024-03-11 08:19:03 +00:00
on:
pull_request:
types:
- opened
- synchronize
- labeled
2024-03-11 08:21:22 +00:00
workflow_dispatch:
2024-03-11 08:19:03 +00:00
jobs:
2024-03-11 08:30:19 +00:00
test:
runs-on: ubuntu-latest
steps:
- run: echo ${{github.event.action}}
- run: echo ${{github.event.pull_request.labels.*.name}}
2024-03-11 08:19:03 +00:00
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') &&
2024-03-11 08:27:10 +00:00
contains(github.event.pull_request.labels.*.name, 'watchdog-go')) ||
2024-03-11 08:21:22 +00:00
(github.event.action == 'workflow_dispatch')
2024-03-11 08:19:03 +00:00
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 }}