watchdog-go: ci 手動実行を許可 #1

Merged
usbharu merged 19 commits from ci into master 2024-03-11 10:09:23 +00:00
2 changed files with 44 additions and 24 deletions

View File

@ -1,26 +1,46 @@
on: on:
pull_request: pull_request:
types: types:
- opened - opened
- synchronize - synchronize
- labeled - labeled
workflow_dispatch: workflow_dispatch:
jobs: permissions:
build-docker-image: pull-requests: read
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: jobs:
- uses: actions/checkout@v3 test:
- run: docker login -u usbharu -p ${{ secrets.DEPLOY_TOKEN }} git.usbharu.dev runs-on: ubuntu-latest
- run: docker build ./ watchdog-go -t latest -t ${{ github.sha }} steps:
- run: docker push git.usbharu.dev/usbharu/watchdog-go:${{ github.sha }} - run: echo ${{github.event.action}}
- run: echo ${{ contains(github.event.pull_request.labels.*.name, 'watchdog-go') }}
build-docker-image:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
defaults:
run:
working-directory: ./watchdog-go
if: |
((github.event.action == 'labeled') &&
(github.event.label.name == 'watchdog-go')) ||
((github.event.action == 'synchronized') &&
contains(github.event.pull_request.labels.*.name, 'watchdog-go')) ||
(github.event.action == 'workflow_dispatch')
steps:
- uses: actions/checkout@v3
- uses: https://github.com/docker/setup-buildx-action@v3
- uses: https://github.com/docker/login-action@v3
with:
registry: git.usbharu.dev
username: usbharu
password: ${{ secrets.DEPLOY_TOKEN }}
- uses: https://github.com/docker/build-push-action@v5
with:
context: ./watchdog-go
tags: git.usbharu.dev/usbharu/watchdog-go:latest,git.usbharu.dev/usbharu/watchdog-go:${{ github.sha }}
push: true

0
ignore Normal file
View File