From 5ba1d95e7d8f92bf290b59150802cc072ea738de Mon Sep 17 00:00:00 2001 From: Bhaskar Metiya Date: Fri, 26 Apr 2024 23:06:25 +0530 Subject: [PATCH] manual deploy(34) --- .github/workflows/copyDeploy.yaml | 44 +++++++++++++++++++++++++++++++ index.html | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/copyDeploy.yaml diff --git a/.github/workflows/copyDeploy.yaml b/.github/workflows/copyDeploy.yaml new file mode 100644 index 0000000..1b6f7aa --- /dev/null +++ b/.github/workflows/copyDeploy.yaml @@ -0,0 +1,44 @@ +name: Copy to deploy branch + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Copy files from main to deploy branch + env: + PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + run: | + git config --global user.name 'GitHub Action' + git config --global user.email 'action@github.com' + git checkout -b deploy + git rm -rf . + git checkout main -- . + - name: Install dependencies and build + run: | + git checkout deploy + npm install + npm run build + - name: Remove files and folders except dist + run: | + git checkout deploy + rm -r $(ls -A | grep -v dist | grep -v .git) + - name: Move files from dist to root + run: | + git checkout deploy + mv dist/* . + rm -rf dist + - name: Commit and push changes + env: + PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + run: | + git add . + git commit -m "Push build files to deploy branch" + git push origin deploy -f diff --git a/index.html b/index.html index bf29d18..e6407cc 100644 --- a/index.html +++ b/index.html @@ -105,7 +105,7 @@