_stefanzweifel’s avatar_stefanzweifel’s Twitter Archive—№ 1,455

          1. 🧵 The new GitHub Actions Environments and environment protection rules are live! (for public repositories) Here's a quick and dirty demo on how to add deployments to GitHub Actions. (Test Repo: github.com/stefanzweifel/gh-actions-env-test) ↓
        1. …in reply to @_stefanzweifel
          Write a deployment workflow, which runs all required checks and your deploy script. In this example, I run the test suite before each deployment. The deployment is done by Laravel Forge. We just curl the deployment URL. github.com/stefanzweifel/gh-actions-env-test/blob/main/.github/workflows/deploy.yml
      1. …in reply to @_stefanzweifel
        💡 The workflow is triggered by repository_dispatch or workflow_dispatch events, so I can trigger the deployment from outside GitHub (Slack Command, Alfred Workflow, …). (You might update this to listen to the release event to only deploy when new releases are made.)
    1. …in reply to @_stefanzweifel
      In the repository environment settings, I add people as reviewers for production, so only after manual review stuff goes live.
  1. …in reply to @_stefanzweifel
    After manually triggering the deployment, I can now approve or reject the deployment request. Staging already went live, as there was no review process defined
    1. …in reply to @_stefanzweifel
      After successful deployment, I can see the URL to where my app has been deployed. In the repo under "Environments" there's also a neat deployment log.
      1. …in reply to @_stefanzweifel
        Can't wait till this feature is available to private repositories. 🕺