Skip to content

Commit

Permalink
se agrega workflow CI para publicar imagen de docker en registry
Browse files Browse the repository at this point in the history
  • Loading branch information
anelioalvarez committed Nov 29, 2023
1 parent ec0dd30 commit f8b5c0b
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/publish-image-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Publish Docker Image

on:
workflow_dispatch:
release:
types: [published]

jobs:
publish_image:
name: Push Docker image to DockerHub and GitHub Container Registry
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3

- name: Docker Setup Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
docker.io/darrell27/tuki-backend
tags: |
type=semver,pattern={{version}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker Hub Registry
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit f8b5c0b

Please sign in to comment.