-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (28 loc) · 1.54 KB
/
content-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Build and Push Content
on:
push:
branches: [ master ]
paths:
- "GuildWarsPartySearch.FrontEnd/**"
- ".github/workflows/content-deploy.yaml"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v2
- name: Install sshpass
run: sudo apt-get update && sudo apt-get install -y sshpass
- name: Archive content
run: cd GuildWarsPartySearch.FrontEnd && tar -cvf Content.tar Content
- name: Deploy content to host
shell: pwsh
run: |
echo "Uploading content"
sshpass -p "${{ secrets.HOST_PASS }}" scp -o StrictHostKeyChecking=no GuildWarsPartySearch.FrontEnd/Content.tar ${{ secrets.HOST_USER }}@${{ secrets.HOST_ADDRESS }}:/home/guildwarspartysearch/staging
echo "Extracting content"
sshpass -p "${{ secrets.HOST_PASS }}" ssh -o StrictHostKeyChecking=no ${{ secrets.HOST_USER }}@${{ secrets.HOST_ADDRESS }} "tar -xvf /home/guildwarspartysearch/staging/Content.tar -C /home/guildwarspartysearch/staging"
echo "Copying content into container"
sshpass -p "${{ secrets.HOST_PASS }}" ssh -o StrictHostKeyChecking=no ${{ secrets.HOST_USER }}@${{ secrets.HOST_ADDRESS }} "docker cp /home/guildwarspartysearch/staging/Content/ partysearch:/app"
echo "Cleaning up"
sshpass -p "${{ secrets.HOST_PASS }}" ssh -o StrictHostKeyChecking=no ${{ secrets.HOST_USER }}@${{ secrets.HOST_ADDRESS }} "rm -rf /home/guildwarspartysearch/staging/Content && rm -f /home/guildwarspartysearch/staging/Content.tar"