diff --git a/.github/workflows/git-push.yml b/.github/workflows/git-push.yml index e55d118..e3cc94f 100644 --- a/.github/workflows/git-push.yml +++ b/.github/workflows/git-push.yml @@ -19,16 +19,7 @@ jobs: node-version: '16' - name: Install dependencies run: npm install - - name: Configure Git - run: | - git config --global user.email "${{ secrets.OFFICIAL_ACCOUNT_EMAIL }}" - git config --global user.name "${{ github.actor }}" - - name: Fetch and merge remote changes - run: | - git remote add destination https://github.com/seung365/alphamail-frontend.git - git fetch destination - git merge destination/main --allow-unrelated-histories - - name: Pushes to another repository + - name: Clean destination repository first uses: cpina/github-action-push-to-another-repository@main env: API_TOKEN_GITHUB: ${{ secrets.AUTO_KEY }} @@ -38,5 +29,18 @@ jobs: destination-repository-name: 'alphamail-frontend' user-email: ${{ secrets.OFFICIAL_ACCOUNT_EMAIL }} user-name: ${{ github.actor }} - commit-message: 'Syncing main branch' + commit-message: 'Clean repository before sync' + target-branch: main + force: true + - name: Push updated content + uses: cpina/github-action-push-to-another-repository@main + env: + API_TOKEN_GITHUB: ${{ secrets.AUTO_KEY }} + with: + source-directory: '.' + destination-github-username: 'seung365' + destination-repository-name: 'alphamail-frontend' + user-email: ${{ secrets.OFFICIAL_ACCOUNT_EMAIL }} + user-name: ${{ github.actor }} + commit-message: 'Syncing main branch with updates' target-branch: main