Skip to content

Commit

Permalink
Switch to actions/create-jira-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jcobarreto committed Jan 1, 2024
1 parent f98cb7d commit 9212162
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 21 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
issues: write
pull-requests: write
timeout-minutes: 45

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -164,7 +163,6 @@ jobs:
runs-on: ubuntu-latest
permissions: write-all
needs: [static-checks]

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -224,7 +222,6 @@ jobs:
contents: write
id-token: write
needs: [build-docker-image]

steps:
- name: GSM Secrets
id: secrets_manager
Expand Down Expand Up @@ -265,11 +262,12 @@ jobs:
repository: toptal/actions
token: ${{ steps.parse_secrets.outputs.TOPTAL_REPOACCESSBOT_TOKEN }}
path: ./.github/actions/

- name: Replace toptal/actions/get-job-url@main from trigger-jenkins-job/action.yml
shell: bash
run: |
sed -i 's|toptal/actions/get-job-url@main|./.github/actions/get-job-url|' ./.github/actions/trigger-jenkins-job/action.yml
shell: bash
sed -i 's|toptal/actions/trigger-jenkins-job@main|./.github/actions/trigger-jenkins-job|' ./.github/actions/create-jira-deployment/action.yml
- name: Trigger doc deployment job
uses: ./.github/actions/trigger-jenkins-job/
Expand All @@ -291,9 +289,14 @@ jobs:
job_timeout: "3600"

- name: Create Jira Deployment
uses: toptal/davinci-github-actions/create-jira-deployment@v12.5.1
uses: ./.github/actions/create-jira-deployment/
if: ${{ always() }}
with:
jenkins_url: ${{ steps.parse_secrets.outputs.JENKINS_BUILD_URL }}
jenkins_user: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }}
jenkins_token: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_BUILD_TOKEN }}
jenkins_client_id: ${{ steps.parse_secrets.outputs.JENKINS_BUILD_CLIENT_ID }}
jenkins_sa_credentials: ${{ steps.parse_secrets.outputs.JENKINS_SA_CREDENTIALS }}
token: ${{ env.TOPTAL_DEVBOT_TOKEN }}
environment: staging
environment-url: ${{ steps.temploy.outputs.temployURL }}
Expand Down
31 changes: 24 additions & 7 deletions .github/workflows/davinci-alpha-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ jobs:
workload_identity_provider: ${{ secrets.IDENTITY_POOL }}
service_account: ${{ secrets.SA_IDENTITY_POOL }}
secrets_name: |-
HTTP_PROXY:toptal-ci/HTTP_PROXY
JENKINS_BUILD_CLIENT_ID:toptal-ci/JENKINS_BUILD_CLIENT_ID
JENKINS_BUILD_URL:toptal-ci/JENKINS_BUILD_URL
JENKINS_SA_CREDENTIALS:toptal-ci/JENKINS_SA_CREDENTIALS
NPM_TOKEN_PUBLISH:toptal-ci/NPM_TOKEN_PUBLISH
TOPTAL_DEVBOT_TOKEN:toptal-ci/TOPTAL_DEVBOT_TOKEN
TOPTAL_REPOACCESSBOT_TOKEN:toptal-ci/TOPTAL_REPOACCESSBOT_TOKEN
TOPTAL_TRIGGERBOT_BUILD_TOKEN:toptal-ci/TOPTAL_TRIGGERBOT_BUILD_TOKEN
TOPTAL_TRIGGERBOT_USERNAME:toptal-ci/TOPTAL_TRIGGERBOT_USERNAME
Expand Down Expand Up @@ -132,13 +135,27 @@ jobs:
target_url: process.env.STATUS_TARGET_URL
})
- uses: toptal/davinci-github-actions/[email protected]
name: Create Jira deployment
env:
JENKINS_USER: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }}
JENKINS_BUILD_TOKEN: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_BUILD_TOKEN }}
PROXY: http://${{ steps.parse_secrets.outputs.HTTP_PROXY }}
- name: Get toptal/actions
uses: actions/checkout@v4
with:
repository: toptal/actions
token: ${{ steps.parse_secrets.outputs.TOPTAL_REPOACCESSBOT_TOKEN }}
path: ./.github/actions/

- name: Replace toptal/actions/get-job-url@main from trigger-jenkins-job/action.yml
shell: bash
run: |
sed -i 's|toptal/actions/get-job-url@main|./.github/actions/get-job-url|' ./.github/actions/trigger-jenkins-job/action.yml
sed -i 's|toptal/actions/trigger-jenkins-job@main|./.github/actions/trigger-jenkins-job|' ./.github/actions/create-jira-deployment/action.yml
- name: Create Jira deployment
uses: ./.github/actions/create-jira-deployment/
with:
jenkins_url: ${{ steps.parse_secrets.outputs.JENKINS_BUILD_URL }}
jenkins_user: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }}
jenkins_token: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_BUILD_TOKEN }}
jenkins_client_id: ${{ steps.parse_secrets.outputs.JENKINS_BUILD_CLIENT_ID }}
jenkins_sa_credentials: ${{ steps.parse_secrets.outputs.JENKINS_SA_CREDENTIALS }}
token: ${{ env.GITHUB_TOKEN }}
environment: development
environment-url: https://www.npmjs.com/package/@toptal/picasso?activeTab=versions
20 changes: 12 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
workload_identity_provider: ${{ secrets.IDENTITY_POOL }}
service_account: ${{ secrets.SA_IDENTITY_POOL }}
secrets_name: |-
HTTP_PROXY:toptal-ci/HTTP_PROXY
NPM_TOKEN_PUBLISH:toptal-ci/NPM_TOKEN_PUBLISH
SLACK_BOT_TOKEN:toptal-ci/SLACK_BOT_TOKEN
TOPTAL_BUILD_BOT_TOKEN:toptal-ci/TOPTAL_BUILD_BOT_TOKEN
Expand Down Expand Up @@ -80,11 +79,13 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies (from network)
if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }}
run: |
yarn policies set-version
yarn install --frozen-lockfile
- name: Install Dependencies (from cache)
if: ${{ steps.yarn-cache.outputs.cache-hit == 'true' }}
run: |
Expand Down Expand Up @@ -149,9 +150,10 @@ jobs:
path: ./.github/actions/

- name: Replace toptal/actions/get-job-url@main from trigger-jenkins-job/action.yml
shell: bash
run: |
sed -i 's|toptal/actions/get-job-url@main|./.github/actions/get-job-url|' ./.github/actions/trigger-jenkins-job/action.yml
shell: bash
sed -i 's|toptal/actions/trigger-jenkins-job@main|./.github/actions/trigger-jenkins-job|' ./.github/actions/create-jira-deployment/action.yml
- name: Trigger build image job
uses: ./.github/actions/trigger-jenkins-job
Expand Down Expand Up @@ -211,6 +213,7 @@ jobs:
slack-message: "Current master version of Picasso successfully released :green_heart:"
env:
SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }}

- name: Send a Slack notification on success PR merge
if: ${{ success() && steps.changesets.outputs.published != 'true'}}
uses: slackapi/[email protected]
Expand All @@ -220,14 +223,15 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }}

- uses: toptal/davinci-github-actions/create-jira-deployment@v12.5.1
name: Create Jira deployment
- name: Create Jira deployment
uses: ./.github/actions/create-jira-deployment/
if: ${{ steps.changesets.outputs.published == 'true' }}
env:
JENKINS_USER: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }}
JENKINS_BUILD_TOKEN: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_BUILD_TOKEN }}
PROXY: http://${{ steps.parse_secrets.outputs.HTTP_PROXY }}
with:
jenkins_url: ${{ steps.parse_secrets.outputs.JENKINS_BUILD_URL }}
jenkins_user: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }}
jenkins_token: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_BUILD_TOKEN }}
jenkins_client_id: ${{ steps.parse_secrets.outputs.JENKINS_BUILD_CLIENT_ID }}
jenkins_sa_credentials: ${{ steps.parse_secrets.outputs.JENKINS_SA_CREDENTIALS }}
token: ${{ env.DEVBOT_TOKEN }}
environment: production
environment-url: https://www.npmjs.com/package/@toptal/picasso?activeTab=versions
Expand Down

0 comments on commit 9212162

Please sign in to comment.