Skip to content

Commit

Permalink
chore(ci): add dependabot config and release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hbollon committed Sep 10, 2024
1 parent 407b540 commit 0cb5ff9
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
# Dependency update will be run each week on monday
interval: "weekly"
labels:
- "dependencies"
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-major" # Ignore major updates
- "version-update:semver-minor" # Ignore minor updates
30 changes: 30 additions & 0 deletions .github/workflows/dependabot_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Dependabot PR Auto Approve and Merge

on:
pull_request:
types:
- opened

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event.label.name == 'dependencies' }}

steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Enable auto merge
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: GHCR Release CI

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
tests:
name: Release new Docker Image in GHCR
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 20

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.repository_owner}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Build Docker images for GHCR
run: make build_ghcr

- name: Push Docker images to GHCR
run: make push_ghcr
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export DOCKER_BUILDKIT=1

.PHONY: install
install: ## Install npm dependencies
npm run build
npm install

.PHONY: build
build: install ## Build npm project
Expand Down

0 comments on commit 0cb5ff9

Please sign in to comment.