Create docker-image.yml

This commit is contained in:
Gabriel Kheisa 2024-04-14 14:59:48 +07:00 committed by GitHub
parent 107c837fe8
commit e3d935f6da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

@ -0,0 +1,23 @@
name: Build and Publish Docker Image
on:
push:
branches:
- main # Trigger the workflow on pushes to the main branch
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Login to GitHub Packages Docker registry
run: echo "${{ secrets.GH_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.repository_owner }} --password-stdin
- name: Build Docker image
run: docker build -t docker.pkg.github.com/${{ github.repository }}/${{ github.repository }}:latest .
- name: Push Docker image
run: docker push docker.pkg.github.com/${{ github.repository }}/${{ github.repository }}:latest