Skip to content

Commit 7dd953b

Browse files
committed
Add .github/workflows/build-n-push.yml
1 parent 93f37c6 commit 7dd953b

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/build-n-push.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
tags:
8+
- '[0-9]+.[0-9]+.[0-9]+'
9+
10+
env:
11+
IMAGE_NAME: kjuly/ruby-alpine-build-base
12+
13+
permissions:
14+
contents: read
15+
packages: write
16+
id-token: write
17+
attestations: write
18+
19+
concurrency:
20+
group: "images"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
build-n-push-image:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Build and Push Image to Docker Hub
31+
uses: kjuly/docker-image-publisher@main
32+
with:
33+
image_name: ${{ env.IMAGE_NAME }}
34+
username: ${{ secrets.DOCKERHUB_USERNAME }}
35+
token: ${{ secrets.DOCKERHUB_TOKEN }}
36+
37+
- name: Build and Push Image to Github Container Registry
38+
uses: kjuly/docker-image-publisher@main
39+
with:
40+
registry: ghcr.io
41+
image_name: ${{ env.IMAGE_NAME }}
42+
username: ${{ github.actor }}
43+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)