forked from fga-eps-mds/2023-2-GEROcuidado-APIForum
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from fga-eps-mds/devops/fixes-pipeline
Corrige trigger de pipeline de commit de métricas
- Loading branch information
Showing
2 changed files
with
39 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
# Aqui realizamos o deploy do microserviço fazendo push da imagem docker atualizada | ||
# com a versão mais recente do código para o Dockerhub. Depois fazemos o deploy no EC2 | ||
# que nada mais é que um git pull e restartar os containers do micro-serviço | ||
# | ||
# Nesse mesmo workflow temos a action de release, que cria uma release no github | ||
# caso seja feito um push de tag com nome no formato vX.Y.Z | ||
# | ||
name: Deploy | ||
|
||
on: | ||
|
@@ -45,3 +52,27 @@ jobs: | |
cd ${{env.TARGET_DIR}} | ||
sudo git pull | ||
sudo docker compose -f docker-compose.prod.yml up --force-recreate --build --pull always --remove-orphans -d | ||
release: | ||
name: Release | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: Create Release | ||
if: startsWith(github.ref, 'refs/tags') | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref_name }} | ||
release_name: Release ${{ github.ref_name }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Envia métricas como assets da release | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: AButler/[email protected] | ||
with: | ||
files: 'analytics-raw-data/*' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
release-tag: ${{ github.ref_name }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
# Aqui buscamos no Sonar um relatório em formato JSON | ||
# e enviamos para o repositório de DOC. | ||
|
||
name: Export de métricas | ||
|
||
on: | ||
push: | ||
branches: [main, develop] | ||
tags: | ||
- "v*" | ||
pull_request: # TODO: revisitar isso aqui. Garantir o envio do JSON no sonar na Release | ||
branches: | ||
- main | ||
- develop | ||
types: [closed] | ||
|
||
jobs: | ||
release: | ||
|
@@ -30,11 +34,3 @@ jobs: | |
git add . | ||
git commit -m "Adicionando métricas do repositório ${{ github.event.repository.name }} ${{ github.ref_name }}" | ||
git push | ||
- name: Envia métricas como assets da release | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: AButler/[email protected] | ||
with: | ||
files: 'analytics-raw-data/*' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
release-tag: ${{ github.ref_name }} |