Add Ask Me Anything #219
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
name: Deploy site | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
DEPLOY_USER: ${{secrets.DEPLOY_USER}} | |
DEPLOY_HOST: ${{secrets.DEPLOY_HOST}} | |
DEPLOY_PORT: ${{secrets.DEPLOY_PORT}} | |
DEPLOY_KEY: ${{secrets.DEPLOY_KEY}} | |
DEPLOY_TARGET: ${{secrets.DEPLOY_TARGET}} | |
DEPLOY_OPTIONS: ${{secrets.DEPLOY_OPTIONS}} | |
steps: | |
- name: Verify all required secrets are set | |
run: | | |
[ -z "$DEPLOY_USER" ] && echo "Missing DEPLOY_USER secret" && exit 1 | |
[ -z "$DEPLOY_HOST" ] && echo "Missing DEPLOY_HOST secret" && exit 1 | |
[ -z "$DEPLOY_PORT" ] && echo "Missing DEPLOY_PORT secret" && exit 1 | |
[ -z "$DEPLOY_KEY" ] && echo "Missing DEPLOY_KEY secret" && exit 1 | |
[ -z "$DEPLOY_TARGET" ] && echo "Missing DEPLOY_TARGET secret" && exit 1 | |
exit 0 | |
- name: Checkout site | |
uses: actions/checkout@v2 | |
- name: Setup ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
bundler-cache: true | |
- name: Setup SSH | |
run: | | |
mkdir -p ~/.ssh | |
echo "Host $DEPLOY_HOST" > ~/.ssh/config | |
echo " Port $DEPLOY_PORT" >> ~/.ssh/config | |
echo " StrictHostKeyChecking no" >> ~/.ssh/config | |
cat ~/.ssh/config | |
echo "$DEPLOY_KEY" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa ~/.ssh/config | |
- name: Build site | |
run: bin/build | |
- name: Deploy site | |
run: bin/deploy |