Skip to content

Commit Inicial

Commit Inicial #2

Workflow file for this run

name: CI-CD
on:
workflow_dispatch:
push:
env:
docker_image: fabricioveronez/nodejs-web
jobs:
CI:
runs-on: ubuntu-latest
steps:
- name: Obtendo o código
uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKERHUB_USER}}
password: ${{secrets.DOCKERHUB_PWD}}
- name: Construção da imagem Docker worker
uses: docker/build-push-action@v5
with:
context: ./src
file: ./src/Dockerfile
push: true
tags: |
"${{ env.docker_image }}:${{github.run_number}}"
"${{ env.docker_image }}:latest"
CD:
runs-on: ubuntu-latest
needs: [CI]
steps:
- name: Obtendo o código
uses: actions/checkout@v3
- name: Configuração do Kubeconfig
uses: azure/k8s-set-context@v4
with:
method: kubeconfig
kubeconfig: ${{ secrets.K8S_CONFIG }}
- name: Deploy no cluster Kubernetes
uses: Azure/k8s-deploy@v5
with:
manifests: |
./k8s/deployment.yaml
images: |
"${{ env.docker_image }}:${{github.run_number}}"