-
Notifications
You must be signed in to change notification settings - Fork 11
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
Jan Staněk
committed
Sep 22, 2022
1 parent
475559f
commit 888fd6f
Showing
1 changed file
with
73 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: deploy-nsj-dev | ||
|
||
on: | ||
push: | ||
branches: [nsj/master] | ||
|
||
concurrency: | ||
group: environment-nsj-dev | ||
|
||
jobs: | ||
deploy: | ||
name: "Deploy to srs-dev.skauting.cz" | ||
environment: srs-dev.skauting.cz | ||
runs-on: ubuntu-20.04 | ||
container: | ||
image: skaut/lebeda:8.0 | ||
env: | ||
CONFIG_DATABASE_HOST: ${{ secrets.CONFIG_DATABASE_HOST }} | ||
CONFIG_DATABASE_NAME: ${{ secrets.CONFIG_DATABASE_NAME }} | ||
CONFIG_DATABASE_PASSWORD: ${{ secrets.CONFIG_DATABASE_PASSWORD }} | ||
CONFIG_DATABASE_USER: ${{ secrets.CONFIG_DATABASE_USER }} | ||
CONFIG_MAIL_HOST: | ||
CONFIG_MAIL_PASSWORD: | ||
CONFIG_MAIL_PORT: 0 | ||
CONFIG_MAIL_SECURE: | ||
CONFIG_MAIL_SMTP: false | ||
CONFIG_MAIL_USERNAME: | ||
CONFIG_SKAUTIS_APPLICATION_ID: ${{ secrets.CONFIG_SKAUTIS_APPLICATION_ID }} | ||
CONFIG_SKAUTIS_TEST_MODE: ${{ secrets.CONFIG_SKAUTIS_TEST_MODE }} | ||
CONFIG_RECAPTCHA_SITE_KEY: ${{ secrets.CONFIG_RECAPTCHA_SITE_KEY }} | ||
CONFIG_RECAPTCHA_SECRET_KEY: ${{ secrets.CONFIG_RECAPTCHA_SECRET_KEY }} | ||
DEPLOY_DIRECTORY: ${{ secrets.DEPLOY_DIRECTORY }} | ||
DEPLOY_SSH_HOST: ${{ secrets.DEPLOY_SSH_HOST }} | ||
DEPLOY_SSH_IP: ${{ secrets.DEPLOY_SSH_IP }} | ||
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} | ||
DEPLOY_SSH_PORT: ${{ secrets.DEPLOY_SSH_PORT }} | ||
DEPLOY_SSH_USERNAME: ${{ secrets.DEPLOY_SSH_USERNAME }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Copy & paste from https://github.com/actions/cache/blob/master/examples.md#php---composer | ||
- name: Get composer cache | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install yarn | ||
run: | | ||
apt-get update | ||
apt-get install -y npm | ||
npm install --global yarn | ||
#Copy & paste from https://github.com/actions/cache/blob/master/examples.md#node---yarn | ||
- name: Get yarn cache | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- uses: actions/cache@v1 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Setup SSH key and deploy | ||
run: | | ||
mkdir -p /root/.ssh | ||
ssh-keyscan -H "${DEPLOY_SSH_HOST}","${DEPLOY_SSH_IP}" >> /root/.ssh/known_hosts | ||
eval `ssh-agent -s` | ||
echo "${DEPLOY_SSH_KEY}" | tr -d '\r' | ssh-add - | ||
phing deploy |