Create docker-image.yml pipeline

This commit is contained in:
Gabriel Kheisa 2025-02-12 19:15:15 +07:00 committed by GitHub
parent aa368e3174
commit 356a3a2d21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

37
.github/workflows/docker-image.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Build and Push Docker Image
on:
push:
branches:
- main # Runs when pushing to main branch
workflow_dispatch: # Allows manual triggering
permissions:
contents: read
packages: write # Needed to push to GHCR
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker Image
run: |
docker build -t ghcr.io/${{ github.repository_owner }}/resume-summarizer:latest .
- name: Push Docker Image to GHCR
run: |
docker push ghcr.io/${{ github.repository_owner }}/resume-summarizer:latest