Merge pull request #40 from thomasKn/thomas/fv-242-finish-collection-… #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############### | |
# This Workflow is used to mirror the main branch to a preview branch. | |
# Each time the main branch is updated, the preview branch will be updated. | |
# Useful for having a fixed preview URL that can be used by Sanity Studio. | |
# The SANITY_STUDIO_USE_STEGA environment variable should be set to true for the preview branch. | |
# Github Worflow permissions should be set to Read and write => https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-the-default-github_token-permissions | |
# If using Vercel, the Vercel Authentication setting should be disabled => https://vercel.com/docs/security/deployment-protection/methods-to-protect-deployments/vercel-authentication#managing-vercel-authentication | |
############### | |
name: Sanity Preview Branch | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
mirror: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Fetch latest changes | |
run: git fetch origin main | |
- name: Push to Mirror Branch | |
run: | | |
git checkout -b preview | |
git push --force origin preview | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |