|
| 1 | +name: Integration |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + test: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - run: mkdir $HOME/.ssh |
| 17 | + - name: Remove and cleanup mysql |
| 18 | + run: | |
| 19 | + sudo apt-get remove --purge mysql* |
| 20 | + sudo apt-get autoremove |
| 21 | + sudo apt-get autoclean |
| 22 | + sudo rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld ~/.mysql_history |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + with: |
| 25 | + fetch-depth: 0 |
| 26 | + - uses: actions/setup-python@v2 |
| 27 | + with: |
| 28 | + python-version: '3.9' |
| 29 | + - uses: ./.github/actions/setup-step-ca |
| 30 | + - uses: roots/setup-trellis-cli@v1 |
| 31 | + with: |
| 32 | + ansible-vault-password: 'fake' |
| 33 | + auto-init: false |
| 34 | + galaxy-install: false |
| 35 | + trellis-directory: '.' |
| 36 | + - name: Create new Trellis project |
| 37 | + run: trellis new --name example.com --host www.example.com --trellis-version ${{ github.sha }} ./example.com |
| 38 | + - name: Update configs |
| 39 | + run: | |
| 40 | + sudo echo "127.0.0.1 www.example.com example.com www.example-https.com example-https.com" | sudo tee -a /etc/hosts |
| 41 | + cp ../../.github/files/inventory hosts/production |
| 42 | + cp ../../.github/files/wordpress_sites.yml group_vars/production/wordpress_sites.yml |
| 43 | + cp ../../.github/files/vault.yml group_vars/production/vault.yml |
| 44 | + working-directory: example.com/trellis |
| 45 | + - run: trellis exec ansible-playbook --version |
| 46 | + working-directory: example.com/trellis |
| 47 | + - name: Provision |
| 48 | + run: trellis provision --extra-vars "web_user=runner letsencrypt_ca=https://127.0.0.1:8443/acme/acme" production |
| 49 | + working-directory: example.com |
| 50 | + - name: Deploy non-https site |
| 51 | + run: trellis deploy --extra-vars "web_user=runner project_git_repo=https://github.com/roots/bedrock.git" production example.com |
| 52 | + working-directory: example.com |
| 53 | + - name: Install WordPress |
| 54 | + run: | |
| 55 | + wp core install --url="http://example.com" --title="Example.com" --admin_user="admin" --admin_password="password" --admin_email="admin@example.com" |
| 56 | + working-directory: /srv/www/example.com/current |
| 57 | + - name: Verify install |
| 58 | + run: curl -s http://example.com | grep "<title>Example" |
| 59 | + - name: Deploy https site |
| 60 | + run: trellis deploy --extra-vars "web_user=runner project_git_repo=https://github.com/roots/bedrock.git" production example-https.com |
| 61 | + working-directory: example.com |
| 62 | + - name: Install WordPress |
| 63 | + run: | |
| 64 | + wp core install --url="http://example-https.com" --title="Example HTTPS" --admin_user="admin" --admin_password="password" --admin_email="admin@example.com" |
| 65 | + working-directory: /srv/www/example-https.com/current |
| 66 | + - name: Verify install |
| 67 | + run: curl -s https://example-https.com | grep "<title>Example HTTPS" |
0 commit comments