Skip to content

Commit

Permalink
ci: add publish-docker-image.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
bendanzhentan committed Nov 29, 2023
1 parent a69c818 commit 2ca863c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Docker Image to GitHub Package Registry

on:
push:
branches: [ main, develop ]
tags:

jobs:
build-and-push-image:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

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

- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:latest

0 comments on commit 2ca863c

Please sign in to comment.