diff --git a/.github/workflows/react-cicd.yml b/.github/workflows/react-cicd.yml new file mode 100644 index 0000000..95c0653 --- /dev/null +++ b/.github/workflows/react-cicd.yml @@ -0,0 +1,35 @@ +name: git push into another repo to deploy to vercel + +on: + pull_request: + types: [closed] + branches: + - main + paths: + - "frontend/**" + - ".github/workflows/react-cicd.yml" + +jobs: + build: + runs-on: ubuntu-latest + container: pandoc/latex + steps: + - uses: actions/checkout@v4 + - name: Install mustache (to update the date) + run: apk add ruby && gem install mustache + - name: creates output + run: sh ./build.sh + - name: Pushes to another repository + id: push_directory + uses: cpina/github-action-push-to-another-repository@main + env: + API_TOKEN_GITHUB: ${{ secrets.AUTO_ACTIONS }} + with: + source-directory: "output" + destination-github-username: minsuhan1 + destination-repository-name: EVolution + user-email: ${{ secrets.EMAIL }} + commit-message: ${{ github.event.commits[0].message }} + target-branch: main + - name: Test get variable exported by push-to-another-repository + run: echo $DESTINATION_CLONED_DIRECTORY diff --git a/frontend/build.sh b/frontend/build.sh new file mode 100644 index 0000000..59594ff --- /dev/null +++ b/frontend/build.sh @@ -0,0 +1,5 @@ +#!/bin/sh +cd ../ +mkdir output +cp -R ./EVolution/frontend/* ./output +cp -R ./output ./EVolution/frontend/ \ No newline at end of file