-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1.08 KB
/
deploy-staging.yml
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
35
36
37
name: Deploy image on merge
concurrency: staging
on:
pull_request:
types:
- closed
branches:
- main
env:
USERNAME: deploy
HOST: wunder-kammer.ru
PORT: 22
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
NAME: wndrkmr-land
REACT_APP_API_URL: https://soroka.f128.science/restapi/v1
jobs:
deploy:
name: Deploy staging
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using ssh key
uses: appleboy/ssh-action@master
with:
host: ${{ env.HOST }}
username: ${{ env.USERNAME }}
key: ${{ secrets.WNDRKMR_SSH_KEY }}
port: ${{ secrets.PORT }}
script: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u dice4x4 --password-stdin
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.event.pull_request.number }}
docker rm -f ${{ env.NAME }}
docker run -dp 8081:3000 --name ${{ env.NAME }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:pr-${{ github.event.pull_request.number }}
docker logout