Skip to content

Commit

Permalink
chore: proof of concept for git/sftp workflow branching
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin-jw committed Oct 31, 2023
1 parent a2309a5 commit 06db35f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/deploy.pantheon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
deploy:
if: ${{ vars.DEPLOY_TO_PANTHEON }}
if: ${{ vars.DEPLOY_TO_PANTHEON_GIT || vars.DEPLOY_TO_PANTHEON_SFTP }}
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -46,7 +46,9 @@ jobs:
eval `ssh-agent`
ssh-add ~/.ssh/id_rsa
# Git-specific deployment steps
- name: Checkout Pantheon remote
if: ${{ vars.DEPLOY_TO_PANTHEON_GIT }}
run: |
git config --global user.email "${{ secrets.PRODUCTION_USER_EMAIL }}"
git config --global user.name "${{ secrets.PRODUCTION_USER_NAME }}"
Expand All @@ -55,6 +57,7 @@ jobs:
git worktree add --track -b prod prod pantheon/master
- name: Copy build artifacts
if: ${{ vars.DEPLOY_TO_PANTHEON_GIT }}
run: |
rm -rf prod/vendor prod/wp-content/plugins prod/wp-content/themes/sparkpress
cp -r vendor prod
Expand All @@ -63,10 +66,17 @@ jobs:
mkdir -p wp-content/plugins
cp -r wp-content/plugins prod/wp-content/plugins
- name: Deploy to Pantheon
- name: Deploy to Pantheon via Git
if: ${{ vars.DEPLOY_TO_PANTHEON_GIT }}
run: |
cd prod
git status | grep "nothing to commit" && exit 0 || git status
git add .
git commit -m "Prod release"
git push pantheon HEAD:master
# SFTP-specific deployment steps
- name: Deploy to Pantheon via SFTP
if: ${{ vars.DEPLOY_TO_PANTHEON_SFTP }}
run: |
echo "This is a test"

0 comments on commit 06db35f

Please sign in to comment.