Skip to content

Merge branch 'main' of github.com:40Q/40q-university #12

Merge branch 'main' of github.com:40Q/40q-university

Merge branch 'main' of github.com:40Q/40q-university #12

Workflow file for this run

# Uncomment this deploy job in this file to use the
# https://github.com/roots/setup-trellis-cli GitHub Action
# for deploying this repo to production when pushing to main.
#
# Make sure you've set up the following secrets in your repo:
# - TRELLIS_DEPLOY_SSH_PRIVATE_KEY
# - TRELLIS_DEPLOY_SSH_KNOWN_HOSTS
# - ANSIBLE_VAULT_PASSWORD
name: Build and Deploy
on:
push:
branches: [ main, develop ]
env:
NODE_VERSION: 18
ENVIRONMENT: ${{ ( github.ref_name == 'main' ) && 'production' || 'staging' }}
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache-dependency-path: yarn.lock
- uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.TRELLIS_DEPLOY_SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.TRELLIS_DEPLOY_SSH_KNOWN_HOSTS }}
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.TRELLIS_DEPLOY_SSH_PRIVATE_KEY }}
- uses: roots/setup-trellis-cli@main
with:
ansible-vault-password: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}
- name: Deploy
run: cd trellis & trellis deploy ${{ env.ENVIRONMENT }}