Skip to content

Commit

Permalink
Заменил публикацию на deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
vshitov committed Jan 11, 2024
1 parent 87af1f9 commit 2da3d55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 46 deletions.
40 changes: 12 additions & 28 deletions .github/workflows/main.yml → .github/workflows/deploy.yml
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
Expand All @@ -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:
Expand All @@ -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
18 changes: 0 additions & 18 deletions .github/workflows/other.yml

This file was deleted.

0 comments on commit 2da3d55

Please sign in to comment.