Deploy Blog #44
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
name: Deploy Blog | |
on: | |
workflow_run: | |
workflows: ["CI"] | |
types: | |
- completed | |
permissions: | |
contents: write | |
jobs: | |
deploy-blog: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# if your docs needs submodules, uncomment the following line | |
# submodules: true | |
- name: Switch to another branch | |
run: | | |
git fetch origin blog | |
git checkout blog | |
- name: Push to destination repository | |
run: | | |
git config --global user.name "aanthonymax" | |
git config --global user.email "[email protected]" | |
git clone https://${{ env.ORG_NAME }}:${{ secrets.SECRET_TOKEN }}@github.com/${{ env.ORG_NAME }}/blog.git | |
cd blog | |
git remote add ${{ env.ORIGINAL_REPO_NAME }} https://${{ env.ORG_NAME }}:${{ secrets.SECRET_TOKEN }}@github.com/${{ env.ORG_NAME }}/${{ env.ORIGINAL_REPO_NAME }}.git | |
git fetch ${{ env.ORIGINAL_REPO_NAME }} | |
git checkout ${{ env.ORIGINAL_REPO_NAME }}/blog -- . || true | |
git add -A | |
git commit -m "Copied changes from ${{ env.ORIGINAL_REPO_NAME }}/blog" || true | |
git push origin blog --force | |
env: | |
GITHUB_TOKEN: ${{ secrets.SECRET_TOKEN }} | |
ORIGINAL_REPO_NAME: ${{ github.event.repository.name }} | |
ORG_NAME: hmpl-language |