Skip to content

Commit

Permalink
Remove setupGit needs
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewGable committed Dec 8, 2021
1 parent b8916ae commit da402c5
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,19 @@ jobs:
- name: Check if merged pull request was an automatic version bump PR
id: isAutomatedPullRequest
run: echo "::set-output name=IS_AUTOMERGE_PR::${{ steps.getMergedPullRequest.outputs.author == 'OSBotify' }}"
setupGit:

deployStaging:
runs-on: ubuntu-latest
needs: validate
if: ${{ fromJSON(needs.validate.outputs.isAutomatedPullRequest) && github.ref == 'refs/heads/staging' }}

steps:
- name: Checkout staging branch
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
ref: staging
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Decrypt Botify GPG key
run: cd .github/workflows && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output OSBotify-private-key.asc OSBotify-private-key.asc.gpg
env:
Expand All @@ -41,17 +49,6 @@ jobs:
git config user.name OSBotify
git config user.email infra+osbotify@expensify.com
deployStaging:
runs-on: ubuntu-latest
needs: [validate, setupGit]
if: ${{ fromJSON(needs.validate.outputs.isAutomatedPullRequest) && github.ref == 'refs/heads/staging' }}

steps:
- name: Checkout staging branch
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
ref: staging
token: ${{ secrets.OS_BOTIFY_TOKEN }}
- name: Tag version
run: git tag $(npm run print-version --silent)
Expand All @@ -61,14 +58,30 @@ jobs:

deployProduction:
runs-on: ubuntu-latest
needs: [validate, setupGit]
needs: validate
if: ${{ fromJSON(needs.validate.outputs.isAutomatedPullRequest) && github.ref == 'refs/heads/production' }}

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
fetch-depth: 0
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Decrypt Botify GPG key
run: cd .github/workflows && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output OSBotify-private-key.asc OSBotify-private-key.asc.gpg
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

- name: Import Botify GPG Key
run: cd .github/workflows && gpg --import OSBotify-private-key.asc

- name: Set up git for Botify
run: |
git config user.signingkey DBF63700F60F5530
git config commit.gpgsign true
git config user.name OSBotify
git config user.email infra+osbotify@expensify.com
- name: Checkout production branch
run: git checkout production
Expand Down

0 comments on commit da402c5

Please sign in to comment.