Skip to content

Commit

Permalink
Merge 926868d into 635f8a0
Browse files Browse the repository at this point in the history
  • Loading branch information
bebstein-pass authored Oct 16, 2024
2 parents 635f8a0 + 926868d commit 9f84ab1
Show file tree
Hide file tree
Showing 21 changed files with 170 additions and 283 deletions.
1 change: 1 addition & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Ces workflows sont utilisés pour déployer le web sur les buckets GCP, et le pr
| dev_on_workflow_environment_ios_deploy.yml | Helper | Automatically | |
| dev_on_workflow_install.yml | Helper | Automatically | |
| dev_on_workflow_linter_ts.yml | Helper | Automatically | |
| dev_on_workflow_slack_notify.yml | Helper | Automatically | |
| dev_on_workflow_tester.yml | Helper | Automatically | |
| dev_on_workflow_web_deploy.yml | Helper | Automatically | |
| dev_on_workflow_web_proxy_deploy.yml | Helper | Automatically | |
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "1 [on_dispatch][Jira] Create/Push ehp deploy tags"
name: '1 [on_dispatch][Jira] Create/Push ehp deploy tags'

on:
workflow_dispatch:
Expand All @@ -21,19 +21,19 @@ jobs:
name: 'Create and push staging tag'
runs-on: ubuntu-22.04
steps:
- name: "Checkout commit hash"
- name: 'Checkout commit hash'
uses: actions/checkout@v4
with:
ref: ${{ inputs.commitHash }}
token: ${{ secrets.PUSH_SERVICE_ACCOUNT }}
- name: "get package version"
- name: 'get package version'
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: "Author"
- name: 'Author'
run: |
git config --global user.email "$GIT_CONFIG_EMAIL"
git config --global user.name "$GIT_CONFIG_NAME"
- name: "Create and push tag from package version"
- name: 'Create and push tag from package version'
id: create_tag
run: |
STAGING_VERSION=${{ steps.package-version.outputs.current-version }}
Expand All @@ -48,11 +48,11 @@ jobs:
with:
ref: master
token: ${{ secrets.PUSH_SERVICE_ACCOUNT }}
- name: "Author"
- name: 'Author'
run: |
git config --global user.email "$GIT_CONFIG_EMAIL"
git config --global user.name "$GIT_CONFIG_NAME"
- name: "Bump package version"
- name: 'Bump package version'
uses: phips28/gh-action-bump-version@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -62,7 +62,7 @@ jobs:
skip-commit: 'true'
skip-tag: 'true'
skip-push: 'true'
- name: "Bump server package version"
- name: 'Bump server package version'
uses: phips28/gh-action-bump-version@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -73,10 +73,10 @@ jobs:
skip-commit: 'true'
skip-tag: 'true'
skip-push: 'true'
- name: "Get package version"
- name: 'Get package version'
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: "Bump build number"
- name: 'Bump build number'
id: build-number
run: |
# We have to increment the build number because it is used as the versionCode
Expand Down Expand Up @@ -104,20 +104,20 @@ jobs:
PATCH=${SEMVER[2]}
BUILD_NUMBER=$((10000000 * MAJOR + 1000 * MINOR + PATCH))
echo build_number=$BUILD_NUMBER >> $GITHUB_OUTPUT
- name: "Update build number in package.json"
- name: 'Update build number in package.json'
uses: sergeysova/jq-action@v2
with:
cmd: jq '.build = ${{ steps.build-number.outputs.build_number }}' package.json > tmp && mv tmp package.json
- name: "Get routes used by app version"
- name: 'Get routes used by app version'
run: |
./scripts/get_used_routes.sh "v${TESTING_VERSION}"
- name: "Commit changes"
- name: 'Commit changes'
run: |
TESTING_VERSION=${{ steps.package-version.outputs.current-version }}
git add package.json server/package.json route_usage_changelog.md
git commit --message "v${TESTING_VERSION}"
git push origin master
- name: "Create and push testing tag"
- name: 'Create and push testing tag'
run: |
TESTING_VERSION=${{ steps.package-version.outputs.current-version }}
TAG_NAME=testing/v${TESTING_VERSION}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev_on_dispatch_service_worker_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "1 [on_dispatch] Service Worker Test"
name: '1 [on_dispatch] Service Worker Test'

on:
workflow_dispatch:
Expand All @@ -8,7 +8,7 @@ on:
required: true
type: string
versionTo:
description: "Nom de la nouvelle release (ex: 1.200.0)"
description: 'Nom de la nouvelle release (ex: 1.200.0)'
required: true
type: string
repository_dispatch:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup Node.JS
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
node-version-file: '.nvmrc'

# Necessary for the latest service worker test script
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_on_pull_request_reassure.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "3 [on_pr] Run Reassure performance tests"
name: '3 [on_pr] Run Reassure performance tests'

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_on_pull_request_title_checker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "3 [on_pr] Check PR title format"
name: '3 [on_pr] Check PR title format'

on:
pull_request:
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/dev_on_push_workflow_main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "2 [pull/pr] Initiate workflow"
name: '2 [pull/pr] Initiate workflow'

on:
push:
branches:
- master
tags:
- "**"
- '**'
pull_request:

permissions:
Expand Down Expand Up @@ -266,7 +266,12 @@ jobs:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-proxy-integration:
needs: [check-server-folder-changes-production, deploy-web-integration, check-proxy-version-production]
needs:
[
check-server-folder-changes-production,
deploy-web-integration,
check-proxy-version-production,
]
if: needs.check-server-folder-changes-production.outputs.folder_changed == 'true' && needs.check-proxy-version-production.outputs.proxy_base_tag
uses: ./.github/workflows/dev_on_workflow_web_proxy_deploy.yml
with:
Expand All @@ -287,7 +292,12 @@ jobs:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
deploy-web-proxy-production:
needs: [check-server-folder-changes-production, deploy-web-production, check-proxy-version-production]
needs:
[
check-server-folder-changes-production,
deploy-web-production,
check-proxy-version-production,
]
if: needs.check-server-folder-changes-production.outputs.folder_changed == 'true' && needs.check-proxy-version-production.outputs.proxy_base_tag
uses: ./.github/workflows/dev_on_workflow_web_proxy_deploy.yml
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_on_workflow_check_folder_change.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Check folder changes"
name: '4 [on_workflow] Check folder changes'

on:
workflow_call:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev_on_workflow_check_proxy_version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Check proxy version"
name: '4 [on_workflow] Check proxy version'

on:
workflow_call:
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
run: echo proxy_version=$(curl -sS ${{ inputs.WEBAPP_URL }}/version.txt) >> $GITHUB_OUTPUT

# The rollback protection use semver-compare-cli from npmregistry, exemple of comparaison
#
#
# semver-compare 1.0.0 ge 1.0.1 => exit 1
# semver-compare 1.0.1 ge 1.0.0 => exit 0
# semver-compare 1.0.0 ge 1.0.0 => exit 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_on_workflow_chromatic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Build, test and deploy storybook with Chromatic"
name: '4 [on_workflow] Build, test and deploy storybook with Chromatic'

on:
workflow_call:
Expand Down
48 changes: 8 additions & 40 deletions .github/workflows/dev_on_workflow_environment_android_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,44 +103,12 @@ jobs:
run: bash -c 'source scripts/upload_sourcemaps_to_sentry.sh;upload_sourcemaps "android" ${{ inputs.ENV }}'

slack_notify:
runs-on: ubuntu-22.04
if: ${{ always() }}
needs: sentry_and_deploy
steps:
- name: Connect to Secret Manager
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
- name: Get secrets for Slack
id: 'slack_secrets'
uses: 'google-github-actions/get-secretmanager-secrets@v2'
with:
secrets: |-
SLACK_BOT_TOKEN:passculture-metier-ehp/passculture-ci-slack-bot-token
- name: Post to a Slack channel
id: slack
if: ${{ steps.sentry_and_deploy.outputs.status == 'failure' || inputs.ENV == 'staging' }}
uses: slackapi/slack-github-action@v1.24.0
with:
# channel #alertes-deploiement-native
channel-id: 'C0309RP8K42'
payload: |
{
"attachments": [
{
"mrkdwn_in": ["text"],
"color": "${{ fromJSON('["#36a64f", "#A30002"]')[steps.sentry_and_deploy.outputs.status == 'failure'] }}",
"author_name": "${{github.actor}}",
"author_link": "https://github.com/${{github.actor}}",
"author_icon": "https://github.com/${{github.actor}}.png",
"title": "PCAPPNATIVE Deployment",
"title_link": "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}",
"text": "Le déploiement Android sur `${{ inputs.ENV }}` a ${{ fromJSON('["réussi :rocket:", "échoué :boom:"]')[steps.sentry_and_deploy.outputs.status == 'failure'] }}"
}
],
"unfurl_links": false,
"unfurl_media": false
}
env:
SLACK_BOT_TOKEN: ${{ steps.slack_secrets.outputs.SLACK_BOT_TOKEN }}
uses: ./.github/workflows/dev_on_workflow_slack_notify.yml
with:
ENV: passculture-infra-prod-github-runner-cache
status: steps.sentry_and_deploy.outputs.status
message: 'Le déploiement Android sur `${{ inputs.ENV }}`'
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
52 changes: 10 additions & 42 deletions .github/workflows/dev_on_workflow_environment_ios_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] iOS deploy"
name: '4 [on_workflow] iOS deploy'

on:
workflow_call:
Expand All @@ -17,7 +17,7 @@ on:

jobs:
sentry_and_deploy:
name: "Install runtime environment and dependencies iOS deploy"
name: 'Install runtime environment and dependencies iOS deploy'
runs-on: macos-14
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -94,44 +94,12 @@ jobs:
run: bash -c 'source scripts/upload_sourcemaps_to_sentry.sh;upload_sourcemaps "ios" ${{ inputs.ENV }}'

slack_notify:
runs-on: ubuntu-22.04
if: ${{ always() }}
needs: sentry_and_deploy
steps:
- name: Connect to Secret Manager
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
- name: Get secrets for Slack
id: 'slack_secrets'
uses: 'google-github-actions/get-secretmanager-secrets@v2'
with:
secrets: |-
SLACK_BOT_TOKEN:passculture-metier-ehp/passculture-ci-slack-bot-token
- name: Post to a Slack channel
id: slack
if: ${{ steps.sentry_and_deploy.outputs.status == 'failure' || inputs.ENV == 'staging' }}
uses: slackapi/slack-github-action@v1.24.0
with:
# channel #alertes-deploiement-native
channel-id: 'C0309RP8K42'
payload: |
{
"attachments": [
{
"mrkdwn_in": ["text"],
"color": "${{ fromJSON('["#36a64f", "#A30002"]')[steps.sentry_and_deploy.outputs.status == 'failure'] }}",
"author_name": "${{github.actor}}",
"author_link": "https://github.com/${{github.actor}}",
"author_icon": "https://github.com/${{github.actor}}.png",
"title": "PCAPPNATIVE Deployment",
"title_link": "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}",
"text": "Le déploiement iOS sur `${{ inputs.ENV }}` a ${{ fromJSON('["réussi :rocket:", "échoué :boom:"]')[steps.sentry_and_deploy.outputs.status == 'failure'] }}"
}
],
"unfurl_links": false,
"unfurl_media": false
}
env:
SLACK_BOT_TOKEN: ${{ steps.slack_secrets.outputs.SLACK_BOT_TOKEN }}
uses: ./.github/workflows/dev_on_workflow_slack_notify.yml
with:
ENV: passculture-infra-prod-github-runner-cache
status: steps.sentry_and_deploy.outputs.status
message: 'Le déploiement iOS sur `${{ inputs.ENV }}`'
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
52 changes: 10 additions & 42 deletions .github/workflows/dev_on_workflow_environment_soft_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "4 [on_workflow] Soft deploy"
name: '4 [on_workflow] Soft deploy'

on:
workflow_call:
Expand All @@ -17,7 +17,7 @@ on:

jobs:
sentry_and_deploy:
name: "Install runtime environment and dependencies Soft deploy"
name: 'Install runtime environment and dependencies Soft deploy'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -85,44 +85,12 @@ jobs:
IOS_APPCENTER_API_TOKEN: ${{ steps.secrets.outputs.IOS_APPCENTER_API_TOKEN }}

slack_notify:
runs-on: ubuntu-22.04
if: ${{ always() }}
needs: sentry_and_deploy
steps:
- name: Connect to Secret Manager
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
- name: Get secrets for Slack
id: 'slack_secrets'
uses: 'google-github-actions/get-secretmanager-secrets@v2'
with:
secrets: |-
SLACK_BOT_TOKEN:passculture-metier-ehp/passculture-ci-slack-bot-token
- name: Post to a Slack channel
id: slack
if: ${{ steps.sentry_and_deploy.outputs.status == 'failure' || inputs.ENV == 'staging' }}
uses: slackapi/slack-github-action@v1.24.0
with:
# channel #alertes-deploiement-native
channel-id: 'C0309RP8K42'
payload: |
{
"attachments": [
{
"mrkdwn_in": ["text"],
"color": "${{ fromJSON('["#36a64f", "#A30002"]')[steps.sentry_and_deploy.outputs.status == 'failure'] }}",
"author_name": "${{github.actor}}",
"author_link": "https://github.com/${{github.actor}}",
"author_icon": "https://github.com/${{github.actor}}.png",
"title": "PCAPPNATIVE Deployment",
"title_link": "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}",
"text": "Le déploiement codePush Android/iOS sur `${{ inputs.ENV }}` a ${{ fromJSON('["réussi :rocket:", "échoué :boom:"]')[steps.sentry_and_deploy.outputs.status == 'failure'] }}"
}
],
"unfurl_links": false,
"unfurl_media": false
}
env:
SLACK_BOT_TOKEN: ${{ steps.slack_secrets.outputs.SLACK_BOT_TOKEN }}
uses: ./.github/workflows/dev_on_workflow_slack_notify.yml
with:
ENV: passculture-infra-prod-github-runner-cache
status: steps.sentry_and_deploy.outputs.status
message: 'Le déploiement codePush Android/iOS sur `${{ inputs.ENV }}`'
secrets:
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }}
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }}
Loading

0 comments on commit 9f84ab1

Please sign in to comment.