fix token #22
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: CI | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: | | |
chmod +x gradlew | |
./gradlew build | |
ls -ltr | |
- name: SonarCloud Analysis | |
run: | | |
chmod +x gradlew | |
./gradlew build sonar -Dsonar.token=${{ secrets.TOKEN_SONARCLOUD }} | |
- name: SonarQube Quality Gate check | |
uses: sonarsource/sonarqube-quality-gate-action@master | |
env: | |
SONAR_TOKEN: ${{ secrets.TOKEN_SONARCLOUD }} | |
SONAR_HOST_URL: https://sonarcloud.io | |
with: | |
scanMetadataReportFile: build/sonar/report-task.txt | |
- name: Docker Login | |
uses: docker/login-action@v2.2.0 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Copia de Jar a Raiz de proyecto | |
run: | | |
cp $GITHUB_WORKSPACE/build/libs/spring-petclinic-2.6.0.jar . | |
chmod 777 spring-petclinic-2.6.0.jar | |
ls -lt | |
- name: Docker Build | |
run: | | |
docker build --tag clagosu/pet-clinic:latest . | |
docker images | |
- name: Docker Push | |
run: | | |
docker push clagosu/pet-clinic | |
deploy: | |
runs-on: self-hosted | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Deploy to Minikube | |
run: | | |
kubectl apply -f deployment.yml | |