Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #143 from PrestaShop/feat/workflows
Browse files Browse the repository at this point in the history
Feat/workflows
  • Loading branch information
jolelievre authored Jul 3, 2023
2 parents 536846f + 5dd9116 commit 6252d08
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/prestonbot-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PrestonBot Integration CICD

concurrency:
group: prestonbot-${{ github.ref }}

on:
pull_request:
types: [opened, edited, reopened, synchronize, labeled]

jobs:

prestonbot-integration:
name: Trigger Integration CICD
runs-on: ubuntu-latest
timeout-minutes: 10
if: contains(github.event.pull_request.labels.*.name, 'integration deployment')

steps:

- name: Get tag
shell: bash
id: get_tag
run: echo TAG=$(echo $GITHUB_REF | cut -d / -f 3) >> $GITHUB_OUTPUT

- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PRESTONBOT_CD_PAT }}
repository: ${{ secrets.PRESTONBOT_CD_REPOSITORY }}
event-type: integration_deployment
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "tag": "${{ steps.get_tag.outputs.TAG }}"}'
31 changes: 31 additions & 0 deletions .github/workflows/prestonbot-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PrestonBot Production CICD

concurrency:
group: prestonbot-${{ github.ref }}

on:
release:
types: [released]

jobs:

prestonbot-production:
name: Trigger Production CICD
runs-on: ubuntu-latest
timeout-minutes: 10
if: startsWith(github.ref, 'refs/tags/')

steps:

- name: Get tag
shell: bash
id: get_tag
run: echo TAG=$(echo $GITHUB_REF | cut -d / -f 3) >> $GITHUB_OUTPUT

- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PRESTONBOT_CD_PAT }}
repository: ${{ secrets.PRESTONBOT_CD_REPOSITORY }}
event-type: production_deployment
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "tag": "${{ steps.get_tag.outputs.TAG }}"}'

0 comments on commit 6252d08

Please sign in to comment.