Skip to content

Commit

Permalink
action to publish image on ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
hcadavid committed Jan 14, 2025
1 parent 0319091 commit f6b449c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build_and_push_on_ghcr_io.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Create Release

on:
push:
branches:
- main

jobs:
create-docker-image:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

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

- name: Run Makefile Rule
run: |
COMMIT_HASH=${{ github.sha }}
IMAGE_NAME="${{ github.repository }}:${COMMIT_HASH}"
docker build -t "${IMAGE_NAME}" .
- name: Push Docker image
run: |
COMMIT_HASH=${{ github.sha }}
IMAGE_NAME="${{ github.repository }}:${COMMIT_HASH}"
docker push "${IMAGE_NAME}"

0 comments on commit f6b449c

Please sign in to comment.