✨ add github workflow auto deploy
Browse files at this commit0ec372b1737fb50e389666548ee9dce8ff318251Parent: 0209580- feat
- ✨ add github workflow auto deploy
4 changed files +27 -40
- .github/workflows/deploy.yaml +20 -0
- .woodpecker/deploy.yaml +0 -32
- README.md +2 -3
- src/projects.rs +5 -5
.github/workflows/deploy.yamladded+20 -0
| @@ -0,0 +1,20 @@ | |||
| 1 | +on: | ||
| 2 | + push: | ||
| 3 | + branches: | ||
| 4 | + - main | ||
| 5 | + | ||
| 6 | +jobs: | ||
| 7 | + pull: | ||
| 8 | + name: Deploy | ||
| 9 | + runs-on: ubuntu-latest | ||
| 10 | + steps: | ||
| 11 | + - name: Install SSH Keys | ||
| 12 | + run: | | ||
| 13 | + mkdir -p ~/.ssh | ||
| 14 | + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa | ||
| 15 | + ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts | ||
| 16 | + - name: Connect and Pull | ||
| 17 | + run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "export PATH="${{ secrets.CARGO_PATH }}:$PATH" && cd ${{ secrets.WORK_DIR }} && git checkout ${{ secrets.MAIN_BRANCH }} && git pull --rebase && dx build --release && cp -r ${{ secrets.ARTIFACT_DIR }} ${{ secrets.DEPLOY_PATH }} && rm -rf ${{ secrets.DEPLOY_PATH }}/personality && mv ${{ secrets.DEPLOY_PATH }}/public ${{ secrets.DEPLOY_PATH }}/personality" | ||
| 18 | + | ||
| 19 | + - name: Cleaning | ||
| 20 | + run: rm -rf ~/.ssh | ||
.woodpecker/deploy.yamldeleted+0 -32
| @@ -1,32 +0,0 @@ | |||
| 1 | -when: | ||
| 2 | - event: | ||
| 3 | - - push | ||
| 4 | - - manual | ||
| 5 | - branch: main | ||
| 6 | - | ||
| 7 | -steps: | ||
| 8 | - build: | ||
| 9 | - image: rust | ||
| 10 | - environment: | ||
| 11 | - SSH_PRIVATE_KEY: | ||
| 12 | - from_secret: SSH_PRIVATE_KEY | ||
| 13 | - SSH_USER: | ||
| 14 | - from_secret: SSH_USER | ||
| 15 | - SSH_HOST: | ||
| 16 | - from_secret: SSH_HOST | ||
| 17 | - CARGO_PATH: | ||
| 18 | - from_secret: CARGO_PATH | ||
| 19 | - WORK_DIR: | ||
| 20 | - from_secret: WORK_DIR | ||
| 21 | - MAIN_BRANCH: | ||
| 22 | - from_secret: MAIN_BRANCH | ||
| 23 | - ARTIFACT_DIR: | ||
| 24 | - from_secret: ARTIFACT_DIR | ||
| 25 | - DEPLOY_PATH: | ||
| 26 | - from_secret: DEPLOY_PATH | ||
| 27 | - commands: | ||
| 28 | - - mkdir -p ~/.ssh | ||
| 29 | - - echo "$${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa | ||
| 30 | - - ssh-keyscan -H $${SSH_HOST} > ~/.ssh/known_hosts | ||
| 31 | - - ssh $${SSH_USER}@$${SSH_HOST} "export PATH="$${CARGO_PATH}:$PATH" && cd $${WORK_DIR} && git checkout $${MAIN_BRANCH} && git pull --rebase && dx bundle --release && cp -r $${ARTIFACT_DIR} $${DEPLOY_PATH} && rm -rf $${DEPLOY_PATH}/personality && mv $${DEPLOY_PATH}/public $${DEPLOY_PATH}/personality" | ||
| 32 | - - rm -rf ~/.ssh | ||
README.mdmodified+2 -3
| @@ -1,6 +1,5 @@ | |||
| 1 | -# personality | 1 | + personality |
| 2 | 2 | ||
| 3 | My personal website | 3 | My personal website |
| 4 | 4 | ||
| 5 | -[](https://ci.codeberg.org/repos/14212) | 5 | +[](https://github.com/Tahinli/personality/actions/workflows/deploy.yaml) |
| 6 | - | ||
src/projects.rsmodified+5 -5
| @@ -151,7 +151,7 @@ pub fn Project(id: i32) -> Element { | |||
| 151 | h3 {"Why I did this ?"} | 151 | h3 {"Why I did this ?"} |
| 152 | div { | 152 | div { |
| 153 | " | 153 | " |
| 154 | - I wanted to learn how can I build package manager since I use them everyday. | 154 | + I wanted to learn how can I build package manager since I use them everyday.g |
| 155 | " | 155 | " |
| 156 | } | 156 | } |
| 157 | 157 | ||
| @@ -168,7 +168,7 @@ pub fn Project(id: i32) -> Element { | |||
| 168 | class:"project", | 168 | class:"project", |
| 169 | h1 {"Personality"} | 169 | h1 {"Personality"} |
| 170 | h5 {"Personal website written in Rust"} | 170 | h5 {"Personal website written in Rust"} |
| 171 | - Link {id: "codeberg_link_in_project_page", to: "https://codeberg.org/Tahinli/personality", "Codeberg"} | 171 | + Link {id: "github_link_in_project_page", to: "https://github.com/Tahinli/personality", "GitHub"} |
| 172 | div { | 172 | div { |
| 173 | " | 173 | " |
| 174 | In this project I wanted to build portfolio website for myself and currently you're viewing what is built. | 174 | In this project I wanted to build portfolio website for myself and currently you're viewing what is built. |
| @@ -308,7 +308,7 @@ pub fn Project(id: i32) -> Element { | |||
| 308 | class:"project", | 308 | class:"project", |
| 309 | h1 {"Voice Chat"} | 309 | h1 {"Voice Chat"} |
| 310 | h5 {"Voice Chat written in Rust."} | 310 | h5 {"Voice Chat written in Rust."} |
| 311 | - Link {id: "codeberg_link_in_project_page", to: "https://codeberg.org/Tahinli/rust_voice_chat", "Codeberg"} | 311 | + Link {id: "github_link_in_project_page", to: "https://github.com/Tahinli/rust_voice_chat", "GitHub"} |
| 312 | div { | 312 | div { |
| 313 | " | 313 | " |
| 314 | In this project I wanted to implement voice chat with QUIC protocol. | 314 | In this project I wanted to implement voice chat with QUIC protocol. |
| @@ -332,7 +332,7 @@ pub fn Project(id: i32) -> Element { | |||
| 332 | class:"project", | 332 | class:"project", |
| 333 | h1 {"WebRTC"} | 333 | h1 {"WebRTC"} |
| 334 | h5 {"WebRTC Voice Chat written in Rust."} | 334 | h5 {"WebRTC Voice Chat written in Rust."} |
| 335 | - Link {id: "source_link_in_project_page", to: "https://source.tahinli.com/Tahinli/rust_webrtc", "Source"} | 335 | + Link {id: "github_link_in_project_page", to: "https://github.com/Tahinli/rust_webrtc", "GitHub"} |
| 336 | div { | 336 | div { |
| 337 | " | 337 | " |
| 338 | In this project I wanted to implement voice chat with WebRTC. | 338 | In this project I wanted to implement voice chat with WebRTC. |
| @@ -356,7 +356,7 @@ pub fn Project(id: i32) -> Element { | |||
| 356 | class:"project", | 356 | class:"project", |
| 357 | h1 {"Voice Chat Room"} | 357 | h1 {"Voice Chat Room"} |
| 358 | h5 {"Voice chat room written in Rust."} | 358 | h5 {"Voice chat room written in Rust."} |
| 359 | - Link {id: "source_link_in_project_page", to: "https://source.tahinli.com/Tahinli/rust_voice_chat_room", "Source"} | 359 | + Link {id: "github_link_in_project_page", to: "https://github.com/Tahinli/rust_voice_chat_room", "GitHub"} |
| 360 | div { | 360 | div { |
| 361 | " | 361 | " |
| 362 | In this project I wanted to implement voice chat room for real-time audio communication with low latency audio processing. | 362 | In this project I wanted to implement voice chat room for real-time audio communication with low latency audio processing. |