Skip to content

Commit

Permalink
Merge pull request #1 from natura-jenkins/TL-1-teste-workflow
Browse files Browse the repository at this point in the history
TL-1-teste-workflow
  • Loading branch information
lucianobeja authored Apr 22, 2024
2 parents f06564f + 5db0426 commit e61abd4
Show file tree
Hide file tree
Showing 11 changed files with 374 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.github @lucianobeja
CODEOWNERS @lucianobeja
60 changes: 60 additions & 0 deletions .github/workflows/basic/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: main

on:
push:
branches:
- dev
workflow_dispatch:

jobs:
Sonnar:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test
run: echo "Teste"

Dependecy-Check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test
run: echo "Teste"

Test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test
run: echo "Teste"

needs: [Sonnar, Dependecy-Check]

Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test
run: echo "Teste"

needs: [Test]

Publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test
run: echo "Teste"

needs: [Build]

17 changes: 17 additions & 0 deletions .github/workflows/basic/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: nodejs

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main

jobs:
workflow-nodejs:
uses: lucianobeja79/workflows-config/.github/workflows/nodejs.yml@main
with:
name: 'workflow-app'

17 changes: 17 additions & 0 deletions .github/workflows/basic/workflow-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: workflow-main

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main

jobs:
workflow-app:
uses: lucianobeja79/workflows-config/.github/workflows/workflow-app.yml@main
with:
name: 'workflow-app'

16 changes: 16 additions & 0 deletions .github/workflows/basic/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: workflow-app

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main

jobs:
workflow-deploy:
uses: lucianobeja79/workflow-deploy/.github/workflows/kubernetes.yml@main
with:
name: 'workflow-app'
25 changes: 25 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on:
workflow_call:
inputs:
NODE_VERSION:
required: true
type: string

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Use Node.js
run: echo "Using Node.js

- name: npm install, build, and test
run: echo "npm install, build, and test"

- name: Zip artifact for deployment
run: echo "Zip artifact for deployment"

- name: Upload artifact for deployment job
run: echo "Upload artifact for deployment job"
32 changes: 32 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
workflow_call:

jobs:
Sonnar:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Sonnar
run: echo "Teste"

Dependecy-Check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Dependecy-Check
run: echo "Teste"

Test-Unit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test Unit
run: echo "Teste"
75 changes: 75 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build Artifact and Deploy

on:
push:
branches:
- main

workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
environment:
description: 'Environment to run tests against'
type: environment
required: true

env:
AZURE_WEBAPP_NAME: my-app-name # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
NODE_VERSION: '16.x' # set this to the node version to use

jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yaml

build:
needs: ci
name: Build
uses: ./.github/workflows/build.yaml

deploy-dev:
needs: build
strategy:
fail-fast: true
matrix:
target: [Development, Perfornance, Quality]
uses: ./.github/workflows/deployment.yaml
with:
target-env: ${{ matrix.target }}
secrets: inherit

functional-test:
needs: deploy-dev
name: Functional Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test Functional
run: echo "Test Functional"

deploy-prd:
needs: functional-test
strategy:
fail-fast: true
matrix:
target: [Production]
uses: ./.github/workflows/deployment.yaml
with:
target-env: ${{ matrix.target }}
secrets: inherit

37 changes: 37 additions & 0 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deployment Multiples Environment

on:
workflow_call:
inputs:
target-env:
required: true
type: string

jobs:
deploy:
name: Deploy to ${{ inputs.target-env }}
permissions:
contents: none
runs-on: ubuntu-latest
environment:
name: ${{ inputs.target-env }}

steps:
- run: echo "🎉 target evn ${{ inputs.target-env}}"
- run: echo "🎉 target evn inputs.target-env"
- run: echo "🍏 is Dev ${{ inputs.target-env }} == 'Development'"
- run: echo "🐧 is Prod ${{ inputs.target-env }} == 'Production'"

- name: Download artifact from build job
run: echo "Download artifact from build job"

- name: unzip artifact for deployment
run: echo "unzip artifact for deployment"

- name: "Deploy to ${{ inputs.target-env }}"
if: inputs.target-env == 'Development'
id: deploy-to-dev
run: echo "Deploy to Dev"

- name: "Deploy to ${{ inputs.target-env }}"
run: echo "Deploy to ${{ inputs.target-env }}"
92 changes: 92 additions & 0 deletions .github/workflows/promo-reviews-reuse/deploy-linear.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build Artifact and Deploy

on:
push:
branches:
- dev

workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
environment:
description: 'Environment to run tests against'
type: environment
required: true

env:
AZURE_WEBAPP_NAME: my-app-name # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
NODE_VERSION: '16.x' # set this to the node version to use

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Use Node.js ${{ env.NODE_VERSION }}
run: echo "Using Node.js ${{ env.NODE_VERSION }}"

- name: npm install, build, and test
run: echo "npm install, build, and test"

- name: Zip artifact for deployment
run: echo "Zip artifact for deployment"

- name: Upload artifact for deployment job
run: echo "Upload artifact for deployment job"

deployDev:
name: Deploy to Dev
permissions:
contents: none
runs-on: ubuntu-latest
needs: build
environment:
name: "Development"
url: ${{ steps.deploy-to-webapp-dev.outputs.run }}

steps:
- name: Download artifact from build job
run: echo "Download artifact from build job"

- name: unzip artifact for deployment
run: echo "unzip artifact for deployment"

- name: "Deploy to Azure Dev WebApp"
id: deploy-to-webapp-dev
run: echo "Deploy to Azure Dev WebApp"


deployProd:
name: Deploy to Production
permissions:
contents: none
runs-on: ubuntu-latest
needs: deployDev
environment:
name: "Production"
url: ${{ steps.deploy-to-webapp-prd.outputs.run }}

steps:
- name: Download artifact from build job
run: echo "Download artifact from build job"

- name: unzip artifact for deployment
run: echo "unzip artifact for deployment"

- name: "Deploy to Azure Dev WebApp"
id: deploy-to-webapp-prd
run: echo "Deploy to Azure Dev WebApp"

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# teste
teste13
sfsdf

0 comments on commit e61abd4

Please sign in to comment.