Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
muratugureminoglu authored Feb 21, 2024
1 parent 96ddd9c commit 8e36f9d
Showing 1 changed file with 29 additions and 24 deletions.
53 changes: 29 additions & 24 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
name: Update Docs

on:
push:
branches:
- master
- '*'
pull_request:
branches:
- '*'
workflow_dispatch:

jobs:
run_pull:
name: docs
runs-on: ubuntu-latest

name: Update Docs
runs-on: self-hosted

container:
image: ubuntu:22.04

steps:
- uses: actions/checkout@v3
- name: make changes
- name: Checkout repository
uses: actions/checkout@v3

- name: Make changes
run: |
sed -i "s^baseUrl:.*^baseUrl:'/docs',^" docusaurus.config.js
sed -i "s^appId.*^appId: '${{ secrets.ALGOLIA_APP_ID }}',^" docusaurus.config.js
sed -i "s^apiKey.*^apiKey: '${{ secrets.ALGOLIA_API_KEY }}',^" docusaurus.config.js
- uses: actions/setup-node@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: npm install
- run: npm run build
- run: cd build && tar -zcvf ../docs.tar .
- name: install ssh keys
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: connect and upload
run: |
scp -r docs.tar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}":"
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "find /home/antmedia.io/public_html/docs/ -type f -not -name "*.tar" -not -path "/home/antmedia.io/public_html/docs/.ssh/*" -exec rm {} \; && tar -zxvf docs.tar && rm -rf docs.tar"
- name: cleanup
run: rm -rf ~/.ssh

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Package build artifacts
run: tar -zcvf docs.tar ./build

0 comments on commit 8e36f9d

Please sign in to comment.