Merge pull request #5 from ecsistem/ci/cd #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout do Repositório | ||
uses: actions/checkout@v2 | ||
- name: Construir a Imagem Docker | ||
run: | | ||
NOME_DA_IMAGEM="${{ github.repository }}" | ||
ETIQUETA_DA_IMAGEM="$(date +%s)" | ||
COMANDO_DE_CONSTRUCAO="docker build . --file Dockerfile --tag $NOME_DA_IMAGEM:$ETIQUETA_DA_IMAGEM" | ||
echo "Construindo imagem Docker: $COMANDO_DE_CONSTRUCAO" | ||
$COMANDO_DE_CONSTRUCAO | ||
- name: Display Image Tag | ||
run: echo "Docker image tag: ${{ github.repository }}:$IMAGE_TAG" | ||