Skip to content

Commit a5df9ca

Browse files
committed
update github workflows
1 parent 6762502 commit a5df9ca

File tree

3 files changed

+68
-13
lines changed

3 files changed

+68
-13
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
open-pull-requests-limit: 0
8+
allow:
9+
- dependency-type: "direct"
10+
update-types: "security"
11+
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"
16+
open-pull-requests-limit: 0
17+
allow:
18+
- dependency-type: "direct"
19+
update-types: "security"

.github/renovate.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:base"
5+
],
6+
"dependencyDashboard": true,
7+
"dependencyDashboardTitle": "Dependency Update Report",
8+
"dryRun": "lookup",
9+
"printConfig": true,
10+
"onboarding": false,
11+
"requireConfig": "optional",
12+
"updateNotScheduled": false,
13+
"packageRules": [
14+
{
15+
"matchUpdateTypes": ["minor", "patch"],
16+
"matchCurrentVersion": "!/^0/",
17+
"automerge": false
18+
}
19+
],
20+
"schedule": ["every weekend"],
21+
"prHourlyLimit": 0,
22+
"prConcurrentLimit": 0
23+
}
Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
name: build and push
1+
---
2+
name: Personal Build and Push
23
on:
34
push:
45
branches:
6+
- "main"
57
- "feature/**"
6-
- main
7-
tags:
8-
- "**"
8+
- "fix/**"
99
pull_request:
1010

11-
env:
12-
IMAGE_NAME: netbirdio/dashboard
13-
1411
jobs:
1512
build_n_push:
1613
runs-on: ubuntu-latest
1714
steps:
1815
- uses: actions/checkout@v3
1916

2017
- name: setup-node
21-
uses: actions/setup-node@v3
18+
uses: actions/setup-node@v4
2219
with:
23-
node-version: '18'
20+
node-version: 'lts/*'
2421
cache: 'npm'
2522

2623
- name: Install dependencies
@@ -39,23 +36,39 @@ jobs:
3936
-
4037
name: Docker meta
4138
id: meta
39+
if: github.event_name != 'pull_request'
4240
uses: docker/metadata-action@v4
4341
with:
44-
images: ${{ env.IMAGE_NAME }}
42+
images: ghcr.io/${{ github.repository_owner }}/netbird-dashboard
4543
-
46-
name: Login to DockerHub
44+
name: Login to GitHub Container Registry
4745
if: github.event_name != 'pull_request'
4846
uses: docker/login-action@v2
4947
with:
50-
username: ${{ secrets.NB_DOCKER_USER }}
51-
password: ${{ secrets.NB_DOCKER_TOKEN }}
48+
registry: ghcr.io
49+
username: ${{ github.repository_owner }}
50+
password: ${{ secrets.GITHUB_TOKEN }}
5251
-
5352
name: Docker build and push
53+
if: github.event_name != 'pull_request'
5454
uses: docker/build-push-action@v3
5555
with:
56+
cache-from: type=gha
57+
cache-to: type=gha,mode=max
5658
context: .
5759
file: docker/Dockerfile
5860
push: ${{ github.event_name != 'pull_request' }}
5961
platforms: linux/amd64,linux/arm64,linux/arm
6062
tags: ${{ steps.meta.outputs.tags }}
6163
labels: ${{ steps.meta.outputs.labels }}
64+
-
65+
name: Delete untagged GHCR images after push
66+
if: github.event_name != 'pull_request'
67+
uses: Chizkiyahu/delete-untagged-ghcr-action@v6
68+
continue-on-error: true
69+
with:
70+
token: ${{ secrets.PAT_GHCR_DELETE_IMAGES }}
71+
untagged_only: true
72+
except_untagged_multiplatform: true
73+
with_sigs: true
74+
owner_type: 'user'

0 commit comments

Comments
 (0)