Deploy App #27
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 App | |
on: | |
workflow_run: | |
workflows: ["CI"] | |
types: | |
- completed | |
permissions: | |
contents: write | |
jobs: | |
deploy-app: | |
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 app | |
git checkout app | |
- 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 }}/app.git | |
cd app | |
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 }}/app -- . || true | |
git add -A | |
git commit -m "Copied changes from ${{ env.ORIGINAL_REPO_NAME }}/app" || true | |
git push origin app --force | |
env: | |
GITHUB_TOKEN: ${{ secrets.SECRET_TOKEN }} | |
ORIGINAL_REPO_NAME: ${{ github.event.repository.name }} | |
ORG_NAME: hmpl-language |