Skip to content

Commit

Permalink
Merge pull request #23 from polywrap/update-cd-workflow
Browse files Browse the repository at this point in the history
chore: update pr logic
  • Loading branch information
dOrgJelli authored Jul 18, 2023
2 parents ab41231 + be05aaf commit 516af6d
Showing 1 changed file with 7 additions and 25 deletions.
32 changes: 7 additions & 25 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ jobs:
defaults:
run:
working-directory: ./implementations/${{ matrix.package }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -99,26 +97,10 @@ jobs:
- name: Deploy
run: yarn deploy

- name: Check for changes in URI.txt
run: |
git add .
git diff --name-only | grep ^URI.txt$
echo "changed=$?" >> $GITHUB_ENV
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Add deployments" -a
if: env.changed == 0

- name: Push changes
run: |
git branch -c main artifacts_${{ matrix.package }}_${{ github.run_id }}
git push origin artifacts_${{ matrix.package }}_${{ github.run_id }}
if: env.changed == 0

- name: Create PR
run: |
gh pr create --title "New deployment artifacts" --body "" --base main --head artifacts_${{ matrix.package }}_${{ github.run_id }}
if: env.changed == 0
- name: PR New URI
uses: peter-evans/create-pull-request@v3
with:
branch: ${{ matrix.package }}-cd-pr-${{github.event.number}}
commit-message: "[CD] ${{ matrix.package }}"
title: "[CD] ${{ matrix.package }}"
body: "Triggered by: https://github.com/${{github.repository}}/pull/${{github.event.number}}"

0 comments on commit 516af6d

Please sign in to comment.