-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vshitov
committed
Jan 11, 2024
1 parent
87af1f9
commit 2da3d55
Showing
2 changed files
with
12 additions
and
46 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
name: main | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
push: | ||
branches: | ||
- main | ||
branches: [main] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
checks: | ||
test-deploy: | ||
if: github.event_name != 'push' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -21,8 +23,7 @@ jobs: | |
run: yarn install --frozen-lockfile | ||
- name: Test build website | ||
run: yarn build | ||
gh-release: | ||
needs: checks | ||
deploy: | ||
if: github.event_name != 'pull_request' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -31,31 +32,14 @@ jobs: | |
with: | ||
node-version: 18 | ||
cache: yarn | ||
- name: Add key to allow access to repository | ||
env: | ||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | ||
run: | | ||
mkdir -p ~/.ssh | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
cat <<EOT >> ~/.ssh/config | ||
Host github.com | ||
HostName github.com | ||
IdentityFile ~/.ssh/id_rsa | ||
EOT | ||
- name: Release to GitHub Pages | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }} | ||
- name: Deploy to GitHub Pages | ||
env: | ||
USE_SSH: true | ||
GIT_USER: git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "gh-actions" | ||
if [ -e yarn.lock ]; then | ||
yarn install --frozen-lockfile | ||
elif [ -e package-lock.json ]; then | ||
npm ci | ||
else | ||
npm i | ||
fi | ||
npx docusaurus deploy | ||
yarn deploy |
This file was deleted.
Oops, something went wrong.