Skip to content

Commit

Permalink
chore: modify pipeline to check for total additions instead of per co…
Browse files Browse the repository at this point in the history
…mmit
  • Loading branch information
tlebon committed Nov 18, 2024
1 parent f981404 commit ac0b39e
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ concurrency:
cancel-in-progress: false

jobs:
production-deploy:
if: github.event_name == 'pull_request' && github.event.action == 'opened' && github.actor != 'dependabot[bot]' && github.event.pull_request.additions > 100
procommit-deploy:
runs-on: buildjet-8vcpu-ubuntu-2204

env:
Expand All @@ -32,17 +31,33 @@ jobs:
- name: Install JS dependencies
run: yarn --immutable

- name: Fetch PR details
id: pr_details
uses: octokit/[email protected]
with:
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check total additions
id: check_additions
run: |
total_additions=$(echo "${{ steps.pr_details.outputs.data }}" | jq '.additions')
echo "Total additions: $total_additions"
echo "::set-output name=total_additions::$total_additions"
- name: Deploy to precommit environment
if: ${{ steps.check_additions.outputs.total_additions > 100 && github.actor != 'dependabot[bot]' }}
uses: einaregilsson/beanstalk-deploy@v22
with:
application_name: ${{env.AWS_APPLICATION_NAME}}
aws_access_key: ${{secrets.WEBTEAM_AWS_ACCESS_KEY_ID}}
aws_secret_key: ${{secrets.WEBTEAM_AWS_SECRET_ACCESS_KEY}}
deployment_package: ${{env.AWS_BUILD_ZIP_PATH}}
application_name: ${{ env.AWS_APPLICATION_NAME }}
aws_access_key: ${{ secrets.WEBTEAM_AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.WEBTEAM_AWS_SECRET_ACCESS_KEY }}
deployment_package: ${{ env.AWS_BUILD_ZIP_PATH }}
environment_name: wire-webapp-precommit
region: eu-central-1
use_existing_version_if_available: true
version_description: ${{github.sha}}
version_label: ${{github.run_id}}
version_description: ${{ github.sha }}
version_label: ${{ github.run_id }}
wait_for_deployment: false
wait_for_environment_recovery: ${{env.DEPLOYMENT_RECOVERY_TIMEOUT_SECONDS}}
wait_for_environment_recovery: ${{ env.DEPLOYMENT_RECOVERY_TIMEOUT_SECONDS }}

0 comments on commit ac0b39e

Please sign in to comment.