This file contains hidden or 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: "Nível 3: Containers e Segurança" | ||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
| branches: [ desafio-nivel-3 ] | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| env: | ||
| CHALLENGE_LEVEL: 3 | ||
| CHALLENGE_NAME: "containers-e-seguranca" | ||
| REGISTRY: ghcr.io | ||
| jobs: | ||
| build-scan-and-push: | ||
| name: "Build, Lint, Trivy Scan e Push no GHCR" | ||
| if: #???? | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # AQUI VAI O CÓDIGO DO DESAFIO :) | ||
| generate-certificate: # DAQUI PARA BAIXO, NÃO ALTERAR | ||
| name: "Desafio Nível 3 - Certificado" | ||
| needs: build-scan-and-push | ||
| if: success() | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: "Gerar certificado" | ||
| run: | | ||
| mkdir -p certificates | ||
| cat > certificates/level-3-certificate.md << EOF | ||
| # Certificado de Conclusão - Nível 3 | ||
| **Descomplicando Github Actions - GitHub Actions Edition** | ||
| --- | ||
| Este certificado atesta que **${{ github.actor }}** concluiu com sucesso: | ||
| ## Nível 3: Containers e Segurança | ||
| **Competências desenvolvidas:** | ||
| - Build de imagem Docker | ||
| - Lint de Dockerfile com Hadolint | ||
| - Scan de vulnerabilidades com Trivy (CRITICAL = 0) | ||
| - Relatório de vulnerabilidades como artefato | ||
| - Smoke test de execução do container | ||
| - Publicação no GitHub Container Registry (GHCR) condicionada ao scan | ||
| - Boas práticas de supply chain | ||
| **Data de conclusão:** $(date) | ||
| **Repositório:** ${{ github.repository }} | ||
| **Workflow:** ${{ github.run_id }} | ||
| --- | ||
| **Badge conquistado:** Containers e Segurança | ||
| --- | ||
| *Certificado gerado automaticamente pelo GitHub Actions* | ||
| *LINUXtips* | ||
| EOF | ||
| - name: "Upload do certificado" | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: level-3-certificate | ||
| path: certificates/ | ||
| retention-days: 30 | ||