This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
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: Update Mock Client for Server Beta | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Setup SSH | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.SERVER_SSH_PRIVATE }}" > ~/.ssh/id_rsa | |
echo "${{ secrets.SERVER_SSH_PUBLIC }}" > ~/.ssh/id_rsa.pub | |
chmod 600 ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa.pub | |
ssh-keyscan -H ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts | |
- name: Copy files to server | |
run: | | |
# Remove existing files in the target directory | |
ssh ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} 'rm -rf ${{ secrets.SERVER_DIRECTORY }}/*' | |
# Copy new files from src to the target directory | |
scp -r src/* ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }}:${{ secrets.SERVER_DIRECTORY }} | |
- name: Change API URL | |
run: ssh ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} '/home/update_api_url.sh' |