watchdog-go: ci 手動実行を許可 #1
|
@ -1,4 +1,4 @@
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
|
@ -6,21 +6,41 @@
|
||||||
- labeled
|
- labeled
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: echo ${{github.event.action}}
|
||||||
|
- run: echo ${{ contains(github.event.pull_request.labels.*.name, 'watchdog-go') }}
|
||||||
|
|
||||||
build-docker-image:
|
build-docker-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ./watchdog-go
|
working-directory: ./watchdog-go
|
||||||
if: |
|
if: |
|
||||||
((github.event.action == 'labeled') &&
|
((github.event.action == 'labeled') &&
|
||||||
(github.event.label.name == 'watchdog-go')) ||
|
(github.event.label.name == 'watchdog-go')) ||
|
||||||
((github.event.action == 'synchronize') &&
|
((github.event.action == 'synchronized') &&
|
||||||
contains(github.event.pull_request.labels.*.name, 'watchdog-go') ||
|
contains(github.event.pull_request.labels.*.name, 'watchdog-go')) ||
|
||||||
(github.event.action == 'workflow_dispatch')
|
(github.event.action == 'workflow_dispatch')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- run: docker login -u usbharu -p ${{ secrets.DEPLOY_TOKEN }} git.usbharu.dev
|
- uses: https://github.com/docker/setup-buildx-action@v3
|
||||||
- run: docker build ./ watchdog-go -t latest -t ${{ github.sha }}
|
- uses: https://github.com/docker/login-action@v3
|
||||||
- run: docker push git.usbharu.dev/usbharu/watchdog-go:${{ github.sha }}
|
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
|
Loading…
Reference in New Issue