Skip to content

Commit 1cce40e

Browse files
authored
Update run workflow on main, plus Dependabot (#6)
1 parent 60211e9 commit 1cce40e

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Dependabot configuration to update GitHub Actions workflows
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
# Location of workflow files
6+
directory: "/.github/workflows"
7+
schedule:
8+
# Options: "daily", "weekly", "monthly"
9+
interval: "daily"
10+
# Optional: specify time in UTC (e.g., "02:00")
11+
time: "02:00"
12+

.github/workflows/docker-publish.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Publish Docker Images
22

33
on:
44
push:
5+
branches:
6+
- main
57
tags:
68
- 'v*.*.*'
79
workflow_dispatch:
@@ -39,7 +41,8 @@ jobs:
3941
username: ${{ secrets.GHCR_USERNAME }}
4042
password: ${{ secrets.GHCR_TOKEN }}
4143

42-
- name: Build and Push Images
44+
- name: Build and Push Tag Images
45+
if: startsWith(github.ref, 'refs/tags/')
4346
uses: docker/build-push-action@v5
4447
with:
4548
builder: ${{ steps.buildx.outputs.name }}
@@ -55,3 +58,19 @@ jobs:
5558
docker.io/viscalyx/devshell-dsc:latest
5659
ghcr.io/viscalyx/devshell-dsc:${{ github.ref_name }}
5760
ghcr.io/viscalyx/devshell-dsc:latest
61+
62+
- name: Build and Push Branch Images
63+
if: github.ref == 'refs/heads/main'
64+
uses: docker/build-push-action@v5
65+
with:
66+
builder: ${{ steps.buildx.outputs.name }}
67+
context: .
68+
# If we use build cache we might not be able bump to latest version installed by Dockerfile when pushing a new tag
69+
# cache-from: "type=registry,ref=ghcr.io/viscalyx/devshell-dsc:buildcache"
70+
# cache-to: "type=registry,ref=ghcr.io/viscalyx/devshell-dsc:buildcache,mode=max"
71+
platforms: linux/amd64,linux/arm64
72+
push: true
73+
provenance: true
74+
tags: |
75+
docker.io/viscalyx/devshell-dsc:${{ github.ref_name }}
76+
ghcr.io/viscalyx/devshell-dsc:${{ github.ref_name }}

0 commit comments

Comments
 (0)