Skip to content

Commit

Permalink
Merge branch 'economiagovbr:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nitaibezerra committed Mar 27, 2023
2 parents 672df15 + 1f334b0 commit 1f7d198
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker_build_and_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Publish Docker Image

on:
push:
tags:
- '*'

jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- 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: Extract tag name
shell: bash
run: echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV

- name: Build and push Docker image with tag
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository_owner }}/ro-dou:${{ env.TAG_NAME }}

- name: Build and push Docker image with latest tag
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository_owner }}/ro-dou:latest

0 comments on commit 1f7d198

Please sign in to comment.