From 34b64e6beb217adca22b1ebda8e6eb566d28d618 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Wed, 18 Sep 2024 17:04:21 +0200 Subject: [PATCH] fix remote repo pushing --- .../frontend_trigger_deployment.yaml | 37 +++++++++++++------ .../.github/workflows/build_app_android.yaml | 4 +- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/frontend_trigger_deployment.yaml b/.gitea/workflows/frontend_trigger_deployment.yaml index 163e477..1f32b0d 100644 --- a/.gitea/workflows/frontend_trigger_deployment.yaml +++ b/.gitea/workflows/frontend_trigger_deployment.yaml @@ -10,15 +10,30 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 - - - name: Push to github remote - uses: https://github.com/actions/cpina/github-action-push-to-another-repository@main - env: - API_TOKEN_GITHUB: ${{ secrets.PUSH_GITHUB_API_TOKEN }} + uses: actions/checkout@v3 with: - source-directory: 'frontend' - destination-github-username: 'moll-re' - destination-repository-name: 'anyway-frontend-builder' - user-email: me@moll.re - target-branch: main + path: 'src' + + - name: Checkout remote repository + uses: actions/checkout@v3 + with: + path: 'dest' + ref: 'main' + github-server-url: 'https://github.com' + repository: 'moll-re/anyway-frontend-builder' + token: ${{ secrets.PUSH_GITHUB_API_TOKEN }} + fetch-depth: 0 + persist-credentials: true + + - name: Copy files to remote repository + run: cp -r src/frontend/. dest/ + + - name: Commit and push changes + run: | + cd dest + git config --global user.email "me@moll.re" + git config --global user.name "[bot]" + git add . + git commit -m "Automatic code update for tag" + git tag -a ${{ github.ref_name }} -m "mirrored tag" + git push origin main --tags diff --git a/frontend/.github/workflows/build_app_android.yaml b/frontend/.github/workflows/build_app_android.yaml index 231dba5..0847a13 100644 --- a/frontend/.github/workflows/build_app_android.yaml +++ b/frontend/.github/workflows/build_app_android.yaml @@ -30,10 +30,10 @@ jobs: REF_NAME: ${{ github.ref_name }} run: # remove the 'v' prefix from the tag name - echo "VERSION=${REF_NAME//v}" >> $GITHUB_ENV + echo "VERSION=${REF_NAME//v}" >> $GITHUB_OUTPUT - name: Run fastlane lane run: bundle exec fastlane deploy working-directory: android env: - VERSION_NAME: ${{outputs.version.VERSION}} + VERSION_NAME: ${{ steps.version.VERSION }}