Skip to content

Commit

Permalink
Add GH action to push hydrogen theme to external repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Cristina de Carvalho committed Nov 16, 2023
1 parent 4e17d18 commit d5cba4c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 20,134 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/push-to-external-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: (main) push to external repo

on:
push:
branches:
- main
paths:
- "templates/hydrogen-theme/**"
pull_request:
branches:
- main
paths:
- "templates/hydrogen-theme/**"

jobs:
push-to-external-repo:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Determine branch
id: branch
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
pr_number="${{ github.event.number }}"
echo "branch=pull-request-${pr_number}" >> $GITHUB_OUTPUT
else
echo "branch=main" >> $GITHUB_OUTPUT
fi
- name: Publish to external repository
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.SSH_DEPLOY_KEY }}
publish_dir: ./templates/hydrogen-theme
external_repository: ${{ vars.EXTERNAL_REPO }}
publish_branch: ${{ steps.branch.outputs.branch }}
allow_empty_commit: true
2 changes: 1 addition & 1 deletion templates/hydrogen-theme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Hydrogen is Shopify’s stack for headless commerce. Hydrogen is designed to dov
- ESLint
- Prettier
- GraphQL generator
- TypeScript and JavaScript flavors
- TypeScript flavors
- Minimal setup of components and routes

## Getting started
Expand Down
Loading

0 comments on commit d5cba4c

Please sign in to comment.