-
Notifications
You must be signed in to change notification settings - Fork 62
43 lines (43 loc) · 1.2 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: CI-CD
on:
push:
branches: ["main"]
workflow_dispatch:
jobs:
CI:
runs-on: ubuntu-latest
steps:
- name: Obtendo o código
uses: actions/[email protected]
- name: Autenticação no Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build da Imagem Docker
uses: docker/[email protected]
with:
context: ./src
file: ./src/Dockerfile
push: true
tags: |
fabricioveronez/aula-primeira-pipeline:v${{ github.run_number }}
fabricioveronez/aula-primeira-pipeline:latest
CD:
runs-on: ubuntu-latest
needs: [CI]
steps:
- name: Obtendo o código
uses: actions/[email protected]
- name: Configuração de contexto do Kubernetes
uses: azure/[email protected]
with:
method: kubeconfig
kubeconfig: ${{ secrets.K8S_CONFIG }}
- name: Execução do Manifesto
uses: Azure/k8s-deploy@v5
with:
manifests: |
./k8s/deployment.yaml
images: |
fabricioveronez/aula-primeira-pipeline:v${{ github.run_number }}