Skip to content

Commit

Permalink
Merge pull request #122 from PrestaShop/feat/migration-nightly-upgrade
Browse files Browse the repository at this point in the history
feat: rework workflow
  • Loading branch information
elodie-bil3 authored Jul 13, 2023
2 parents 06c4b7b + 48ddf4d commit 6dfebeb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 45 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/cd-prestabulle-clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
- develop

env:
TF_VERSION: "1.3.7"
LABELS: ${{toJSON(github.event.pull_request.labels)}}

jobs:
Expand All @@ -31,8 +30,8 @@ jobs:
- name: Trigger clean prestabulle
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: cd-prestabulle-clean.yml
workflow: prestabulle-clean.yml
repo: PrestaShopCorp/qanightlyresults-cd
inputs: '{ "project": "qanightly", "label": "${{ steps.get_bulle.outputs.BULLE }}"}'
inputs: '{ "project": "nightly", "bulle": "${{ steps.get_bulle.outputs.BULLE }}"}'
token: ${{ secrets.TERRAFORM_ACCESS_TOKEN }}
ref: 'refs/heads/main'
21 changes: 6 additions & 15 deletions .github/workflows/integration-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
integration_deployment:
name: Deploy (integration)
runs-on: ubuntu-latest
concurrency: integration-cd
environment: integration
if: contains(github.event.pull_request.labels.*.name, 'prestabulle1') ||
contains(github.event.pull_request.labels.*.name, 'prestabulle2') ||
contains(github.event.pull_request.labels.*.name, 'prestabulle3')
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Authenticating to GCP ⚙️
uses: google-github-actions/auth@v1
with:
project_id: ${{ secrets.GCLOUD_NAMESPACE_INTEGRATION }}
project_id: ${{ secrets.GCP_RUN_PROJECT_ID }}
credentials_json: ${{ secrets.INTEGRATION_GOOGLE_APPLICATION_CREDENTIALS }}

- name: Setting up Cloud SDK ⚙️
Expand All @@ -42,20 +42,11 @@ jobs:
id: branch
uses: tj-actions/branch-names@v5.1

- name: Trigger build
- name: Trigger CI / CD
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: integration-cd-build-qanightly.yml
workflow: integration-cd.yml
repo: PrestaShopCorp/qanightlyresults-cd
inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}"}'
inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}", "bulle": "${{ steps.get_bulle.outputs.BULLE }}", "project": "nightly", "repository": "PrestaShop/nightly-board"}'
token: ${{ secrets.TERRAFORM_ACCESS_TOKEN }}
ref: 'refs/heads/main'

- name: Trigger deploy
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: integration-cd-deploy-qanightly.yml
repo: PrestaShopCorp/qanightlyresults-cd
inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}", "label": "${{ steps.get_bulle.outputs.BULLE }}"}'
token: ${{ secrets.TERRAFORM_ACCESS_TOKEN }}
ref: 'refs/heads/main'
ref: 'refs/heads/main'
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
preprod_deployment:
name: Deploy (preprod)
runs-on: ubuntu-latest
environment: preproduction
concurrency: preprod-cd

steps:
Expand All @@ -21,7 +22,7 @@ jobs:
- name: Authenticating to GCP ⚙️
uses: google-github-actions/auth@v1
with:
project_id: ${{ secrets.GCLOUD_NAMESPACE_PREPROD }}
project_id: ${{ secrets.GCP_RUN_PROJECT_ID }}
credentials_json: ${{ secrets.PREPROD_GOOGLE_APPLICATION_CREDENTIALS }}

- name: Setting up Cloud SDK ⚙️
Expand All @@ -31,20 +32,11 @@ jobs:
id: branch
uses: tj-actions/branch-names@v5.1

- name: Trigger build
- name: Trigger CI / CD
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: preprod-cd-build-qanightly.yml
workflow: preproduction-cd.yml
repo: PrestaShopCorp/qanightlyresults-cd
inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}"}'
token: ${{ secrets.TERRAFORM_ACCESS_TOKEN }}
ref: 'refs/heads/main'

- name: Trigger deploy
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: preprod-cd-deploy-qanightly.yml
repo: PrestaShopCorp/qanightlyresults-cd
inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}"}'
inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}", "project": "nightly", "repository": "PrestaShop/nightly-board"}'
token: ${{ secrets.TERRAFORM_ACCESS_TOKEN }}
ref: 'refs/heads/main'
20 changes: 6 additions & 14 deletions .github/workflows/production-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
production_deployment:
name: Deploy (production)
runs-on: ubuntu-latest
environment: production
concurrency: production-cd

steps:
Expand All @@ -20,7 +21,7 @@ jobs:
- name: Authenticating to GCP ⚙️
uses: google-github-actions/auth@v1
with:
project_id: ${{ secrets.GCLOUD_NAMESPACE_PRODUCTION }}
project_id: ${{ secrets.GCP_RUN_PROJECT_ID }}
credentials_json: ${{ secrets.PRODUCTION_GOOGLE_APPLICATION_CREDENTIALS }}

- name: Setting up Cloud SDK ⚙️
Expand All @@ -30,20 +31,11 @@ jobs:
id: branch
uses: tj-actions/branch-names@v5.1

- name: Trigger build
- name: Trigger CI / CD
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: production-cd-build-qanightly.yml
workflow: production-cd.yml
repo: PrestaShopCorp/qanightlyresults-cd
inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}"}'
inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}", "project": "nightly", "repository": "PrestaShop/nightly-board"}'
token: ${{ secrets.TERRAFORM_ACCESS_TOKEN }}
ref: 'refs/heads/main'

- name: Trigger deploy
uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: production-cd-deploy-qanightly.yml
repo: PrestaShopCorp/qanightlyresults-cd
inputs: '{ "branch": "${{ steps.branch.outputs.current_branch }}"}'
token: ${{ secrets.TERRAFORM_ACCESS_TOKEN }}
ref: 'refs/heads/main'
ref: 'refs/heads/main'

0 comments on commit 6dfebeb

Please sign in to comment.