From 5e06c9a93589bfb2f1132f3320ea3e059a64e713 Mon Sep 17 00:00:00 2001 From: Memet Zx Date: Sun, 8 Oct 2023 00:26:26 +0700 Subject: [PATCH] Add workflow file this workflow file will deploy the output on https://github.com/crownss/crownss.github.io `gh-pages` branch Signed-off-by: Memet Zx --- .github/workflows/deploy.yml | 68 ++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..70470ab --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,68 @@ +name: Build and Deploy + +on: + push: + branches: + - master + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set Up Node.js + uses: actions/setup-node@v2 + with: + node-version: '20.8.0' + + - name: Install Dependencies + run: yarn + + - name: Make Directory & Set Up Secret + run: | + mkdir environment + echo "${{ secrets.ENV }}" > environment/const.js + ls -lah + + - name: Build + run: yarn deploy + - name: Move Back + run: | + cd .. + pwd + ls -lah + - name: clone the repo + run: | + git clone --single-branch --branch gh-pages https://mdswa:${{ secrets.mdswa }}@github.com/Crownss/Crownss.github.io.git + ls -lah + + - name: Prepare The Repo + run: | + cd Crownss.github.io + ls -lah + + - name: Copy Build Files + run: cp -r /home/runner/work/frontend-infoanime-next/out/* . + + - name: Commit and Push Changes + run: | + cd /home/runner/work/frontend-infoanime-next/frontend-infoanime-next/Crownss.github.io/ + git config --global user.name "Mandakara Sadewa" + git config --global user.email "mdswa@zxce3.net" + touch .nojekyll + git add . + git commit -m "Update GitHub Pages" + git push