Skip to content

Commit

Permalink
Add .github/workflows/build-n-push.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Kjuly committed May 7, 2024
1 parent 93f37c6 commit 7dd953b
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build-n-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Push Docker Image

on:
workflow_dispatch:

push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

env:
IMAGE_NAME: kjuly/ruby-alpine-build-base

permissions:
contents: read
packages: write
id-token: write
attestations: write

concurrency:
group: "images"
cancel-in-progress: false

jobs:
build-n-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build and Push Image to Docker Hub
uses: kjuly/docker-image-publisher@main
with:
image_name: ${{ env.IMAGE_NAME }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push Image to Github Container Registry
uses: kjuly/docker-image-publisher@main
with:
registry: ghcr.io
image_name: ${{ env.IMAGE_NAME }}
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7dd953b

Please sign in to comment.