diff --git a/.github/workflows/mirror-action-bitbucket.yml b/.github/workflows/mirror-action-bitbucket.yml deleted file mode 100644 index 6056ea251..000000000 --- a/.github/workflows/mirror-action-bitbucket.yml +++ /dev/null @@ -1,24 +0,0 @@ -# https://github.com/wearerequired/git-mirror-action - -name: Mirror to Bitbucket Repo - -on: [ push, delete, create ] - -# Ensures that only one mirror task will run at a time. -concurrency: - group: git-mirror - -jobs: - git-mirror: - runs-on: ubuntu-latest - steps: - - uses: wearerequired/git-mirror-action@v1 - env: - SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_PRIVATE_KEY }} - # secrets.SSH_PRIVATE_KEY - # SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }} - # commented out above, and added below - GIT_SSH_NO_VERIFY_HOST: "true" - with: - source-repo: "git@github.com:hadithmv/hadithmv.github.io.git" - destination-repo: "git@bitbucket.org:hadithmv/hadithmv.github.io.git" diff --git a/.github/workflows/mirror-to-bitbucket-github-action.yml b/.github/workflows/mirror-to-bitbucket-github-action.yml new file mode 100644 index 000000000..120256f19 --- /dev/null +++ b/.github/workflows/mirror-to-bitbucket-github-action.yml @@ -0,0 +1,34 @@ +name: Mirror repository to bitbucket + +on: [push] + +jobs: + secrets-gate: + runs-on: ubuntu-latest + outputs: + ok: ${{ steps.check-secrets.outputs.ok }} + steps: + - name: check for secrets exist + id: check-secrets + run: | + if [ ! -z "${{ secrets.BITBUCKET_USERNAME }}" ]; then + echo "::set-output name=ok::true" + fi + + sync: + needs: + - secrets-gate + if: ${{ needs.secrets-gate.outputs.ok == 'true' }} + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Push + uses: uorz-me/mirror2bitbucket@nodocker + with: + # username: ${{ secrets.BITBUCKET_USERNAME }} + password: ${{ secrets.BITBUCKET_PASSWORD }} \ No newline at end of file