diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index be0ab9b..350c58e 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -73,9 +73,31 @@ jobs: echo "version_changed=false" >> "$GITHUB_OUTPUT" fi - publish-staging: + mirror: runs-on: docker needs: [build-and-test, check-version] + container: + image: node:20-alpine + steps: + - name: Instalando dependencias + run: | + apk add git + + - name: Checkout código + uses: actions/checkout@v4 + with: + fetch-depth: 0 # ✅ clone completo + + - name: Push para o repositório espelho + run: | + git remote add bitbucket https://leandro_costa:${BITBUCKET_TOKEN}@bitbucket.org/leandro_costa/lhmask.git + git push --force bitbucket HEAD + env: + BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }} + + publish-staging: + runs-on: docker + needs: [mirror] container: image: node:20-alpine if: needs.check-version.outputs.version_changed == 'true' && (github.ref == 'refs/heads/development' || startsWith(github.ref, 'refs/heads/release-no-verify/')) @@ -95,7 +117,7 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} publish-production: runs-on: docker - needs: [build-and-test, check-version] + needs: [mirror] container: image: node:20-alpine if: needs.check-version.outputs.version_changed == 'true' && github.ref == 'refs/heads/master' @@ -115,23 +137,10 @@ jobs: env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - mirror: + finish: runs-on: docker container: image: node:20-alpine steps: - - name: Instalando dependencias - run: | - apk add git - - - name: Checkout código - uses: actions/checkout@v4 - with: - fetch-depth: 0 # ✅ clone completo - - - name: Push para o repositório espelho - run: | - git remote add bitbucket https://leandro_costa:${BITBUCKET_TOKEN}@bitbucket.org/leandro_costa/lhmask.git - git push --force bitbucket HEAD - env: - BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }} + - name: Finish task + run: echo Done