Skip to content

Instantly share code, notes, and snippets.

@vburlak
Created September 7, 2020 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vburlak/919b7d1e64d9e6fc997819c299bff512 to your computer and use it in GitHub Desktop.
Save vburlak/919b7d1e64d9e6fc997819c299bff512 to your computer and use it in GitHub Desktop.
Roots Trellis deploy Github Action workflow example with Ansible 2.8 and Trellis Slack Webhook Notify
name: Continuous Deployment
on:
push:
branches:
- staging
- master
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup ssh-agent
uses: webfactory/ssh-agent@v0.4.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-auth-sock: ${{ github.workspace }}/ssh-auth.sock
# Setup GH credentials for upcoming https://github.com/ItinerisLtd/trellis-slack-webhook-notify-during-deploy/pull/7 updates
- name: Setup Git Credentials
uses: oleksiyrudenko/gha-git-credentials@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy Staging
if: github.ref == 'refs/heads/staging'
uses: steenbergen-design/trellis-action@1.0.1
with:
vault_password: ${{ secrets.VAULT_PASS }}
site_env: staging
site_name: example.com
- name: Deploy Production
if: github.ref == 'refs/heads/master'
uses: steenbergen-design/trellis-action@1.0.1
with:
vault_password: ${{ secrets.VAULT_PASS }}
site_env: production
site_name: example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment