-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
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
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
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" |
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