Needed for prod sites. #4
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 Environments | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
env: | |
# Used only for "job.environment" setting. | |
# Must match $DDEV_PROJECT_NAME.$DDEV_PROJECT_TLD for github environment links to work. | |
# @TODO: Update when on live server. | |
# DDEV_PROJECT_DOMAIN: ${{ github.event.repository.name }}.pr${{ github.event.number }}.local.computer | |
# DDEV_PROJECT_PATH: "Sites/${{ github.repository }}/" | |
# Just to make sure the github runner user's PATH is set right. | |
PATH: /usr/bin:/usr/local/bin:/snap/bin | |
jobs: | |
deploy: | |
name: Deploy to ${{ matrix.name }} | |
environment: | |
name: ${{ matrix.project }}.${{ matrix.name }} | |
url: http://${{ matrix.domain }} | |
# @TODO: Launch live runner. | |
# runs-on: live | |
runs-on: [email protected] | |
# Use a matrix for deploying multiple sites. | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: live | |
project: launchpad | |
path: "Sites/${{ github.repository }}/live" | |
domain: "launchpad.thinkdrop.net" | |
domains: "launchpad.thinkdrop.net" | |
git_reference: "main" | |
runner: [email protected] | |
# - name: dev | |
# path: "Sites/${{ github.repository }}/dev" | |
# domains: "dev.thinkdrop.net" | |
# git_reference: main | |
steps: | |
- name: Deploy site | |
uses: operations-project/site-runner-ddev@main | |
with: | |
git-reference: ${{ matrix.git_reference }} | |
path: ${{ matrix.path }} | |
# While we are still hosted elsewhere, the live site should be synced. | |
# sync: "yes" | |
# Remove this after the env is created so live sites don't run ddev start. | |
ddev-start: "yes" | |
ddev-project-name: "${{ matrix.project }}.${{ matrix.name }}" | |
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
ddev-fqdns: ${{ matrix.domains }} |