This repository has been archived by the owner on May 18, 2024. It is now read-only.
Build and Deploy #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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://crownss:${{ secrets.CROWNSS }}@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: | | |
pwd | |
ls .. | |
cp -r out/* Crownss.github.io/ | |
ls -lah | |
- name: Commit and Push Changes | |
run: | | |
cd /home/runner/work/Frontend-InfoAnime-Next/Frontend-InfoAnime-Next/Crownss.github.io/ | |
git config user.name "crownss" | |
git config user.email "[email protected]" | |
touch .nojekyll | |
git add . | |
git commit -am "Update GitHub Pages" | |
git push --prune https://crownss:${{ secrets.CROWNSS }}@github.com/Crownss/Crownss.github.io.git gh-pages |