Skip to content

Commit

Permalink
Merge pull request #2059 from glensc/automerge-dependabot
Browse files Browse the repository at this point in the history
Build: Add automerge job workflow
  • Loading branch information
glensc committed Sep 16, 2024
2 parents cc13ad3 + 89a4c81 commit 5ca96d4
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 10 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
workflow_call:
secrets:
github-token:
required: true

jobs:
# https://github.com/fastify/github-action-merge-dependabot
automerge:
name: Dependabot auto-merge
runs-on: ubuntu-20.04
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}

permissions:
pull-requests: write
contents: write

steps:
- uses: fastify/github-action-merge-dependabot@v3.0.0
with:
target: minor
github-token: ${{ secrets.github-token }}

# vim:ft=yaml:et:ts=2:sw=2
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "CI"

on:
push:
branches:
- main
tags:
- "*.*.*"
pull_request:

jobs:
docker:
uses: ./.github/workflows/docker-image.yml
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

test:
uses: ./.github/workflows/test.yml
if: ${{ github.event_name == 'pull_request' }}

automerge:
uses: ./.github/workflows/automerge.yml
needs:
- docker
- test
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}

# vim:ft=yaml:et:ts=2:sw=2
14 changes: 6 additions & 8 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@
name: Publish Docker image

on:
push:
branches:
- main
tags:
- "*.*.*"
pull_request:
workflow_call:
secrets:
github-token:
required: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_IMAGE: plextraktsync:ci-test

jobs:
build-and-push-image:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -51,7 +49,7 @@ jobs:
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.github-token }}

- name: Extract metadata (tags, labels) for Docker
id: meta
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: Test

on:
- pull_request
workflow_call:

env:
DEFAULT_PYTHON: 3.8

jobs:
test:
runs-on: ubuntu-latest
name: Test
steps:
- name: Check out source repository
uses: actions/checkout@v4
Expand Down

0 comments on commit 5ca96d4

Please sign in to comment.