Skip to content

Merge pull request #2423 from prefeiturasp/feature/121998-parametriza… #673

Merge pull request #2423 from prefeiturasp/feature/121998-parametriza…

Merge pull request #2423 from prefeiturasp/feature/121998-parametriza… #673

Workflow file for this run

name: Dev - CI/CD
on:
push:
branches: [ develop ]
paths-ignore:
- ".github/workflows/**"
workflow_dispatch:
jobs:
sonar:
runs-on: self-hosted
if: ${{ github.ref == 'refs/heads/develop' }}
steps:
- uses: actions/checkout@v2
- name: Sonar
uses: luizhpriotto/action_images@sonarscannercli-v2.0
env:
SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST: http://sonar.sme.prefeitura.sp.gov.br/
- name: send failure message
if: ${{ failure() }}
uses: appleboy/telegram-action@master
with:
to: -571051431
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
💥 Failed in ${{ github.ref_name }}!
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
Actions: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
build:
runs-on: self-hosted
if: ${{ github.ref == 'refs/heads/develop' }}
needs: [ sonar ]
steps:
- uses: actions/checkout@v2
- name: Login to registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PWD }}
- name: Build the Docker image
run: |
docker build . --tag ${{ secrets.REGISTRY_HOST }}/${GITHUB_REF##*/}/ptrf-frontend
docker push ${{ secrets.REGISTRY_HOST }}/${GITHUB_REF##*/}/ptrf-frontend
- name: send failure message
if: ${{ failure() }}
uses: appleboy/telegram-action@master
with:
to: -571051431
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
💥 Failed in ${{ github.ref_name }}!
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
Actions: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
deploy:
runs-on: self-hosted
needs: [ build ]
if: ${{ github.ref == 'refs/heads/develop' }}
environment:
name: development
steps:
- name: Redeploy
uses: luizhpriotto/action_images@kubectl-v2.0
env:
RANCHER_URL: ${{ secrets.RANCHER_URL }}
RANCHER_TOKEN: ${{ secrets.RANCHER_TOKEN }}
NAMESPACE: sme-ptrf
WORKLOAD: ptrf-frontend
- name: send failure message
if: ${{ failure() }}
uses: appleboy/telegram-action@master
with:
to: -571051431
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
💥 Failed in ${{ github.ref_name }}!
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
Actions: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: send success message
if: ${{ success() }}
uses: appleboy/telegram-action@master
with:
to: -571051431
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
🚀 Success in ${{ github.ref_name }}!
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
Actions: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}