Skip to content

Commit

Permalink
GF-168: Add deploy task for Sergey
Browse files Browse the repository at this point in the history
  • Loading branch information
levenkov committed Aug 20, 2020
1 parent e02ca84 commit a9da05d
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Deploy
- name: Install SSH key
env:
SSH_KEY_GPG_PASSPHRASE: ${{ secrets.ssh_key_gpg_passphrase }}
run: |
Expand All @@ -25,6 +25,8 @@ jobs:
HostName almagest.infra.crags.ru
User almagest
EOF
- name: Deploy
run: |
cat << EOF >deploy_script.DeployForMaster.sh
cd services/gekkon-production/frontend && \
git fetch && \
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/sergey.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: DeployForSerg

on:
push:
branches:
- showrooms/sergey
- GF-168

jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Install SSH key
env:
SSH_KEY_GPG_PASSPHRASE: ${{ secrets.ssh_key_gpg_passphrase }}
run: |
mkdir -p ~/.ssh
gpg --quiet --batch --yes --decrypt --passphrase="${SSH_KEY_GPG_PASSPHRASE}" \
--output ~/.ssh/id_rsa.deploy deploy/secrets/deploy.id_rsa.gpg
chmod 600 ~/.ssh/id_rsa.deploy
cat << EOF >>~/.ssh/config
Host deploy
StrictHostKeyChecking no
IdentityFile ~/.ssh/id_rsa.deploy
HostName peclet.infra.crags.ru
Port 22001
User peclet
EOF
- name: Deploy
run: |
cat << EOF >deploy_script.DeployForSerg.sh
cd services/gekkon-staging/frontend_serg && \
git fetch && \
git reset --hard HEAD && \
git checkout showrooms/sergey && \
git reset --hard origin/showrooms/sergey && \
cd .. && \
. ./.env && \
docker-compose build frontend_serg && \
docker-compose up -d frontend_serg
EOF
ssh deploy "$(cat deploy_script.DeployForSerg.sh)"
- name: Purge CloudFlare cache
env:
CLOUDFLARE_STAGING_ZONE: ${{ secrets.cloudflare_staging_zone }}
CLOUDFLARE_STAGING_PURGE_TOKEN: ${{ secrets.cloudflare_staging_purge_token }}
run: |
curl -X POST \
"https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_STAGING_ZONE/purge_cache" \
-d '{ "purge_everything": true }' \
-H "Authorization: Bearer $CLOUDFLARE_STAGING_PURGE_TOKEN" \
-H "Content-Type: application/json"
4 changes: 3 additions & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Deploy
- name: Install SSH key
env:
SSH_KEY_GPG_PASSPHRASE: ${{ secrets.ssh_key_gpg_passphrase }}
run: |
Expand All @@ -26,6 +26,8 @@ jobs:
Port 22001
User peclet
EOF
- name: Deploy
run: |
cat << EOF >deploy_script.DeployForStaging.sh
cd services/gekkon-staging/frontend && \
git fetch && \
Expand Down

0 comments on commit a9da05d

Please sign in to comment.