From 1769636cc88cf8debb8a195e2ab36eef39167f30 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 10 Sep 2022 17:31:47 -0400 Subject: [PATCH] tests: test deploys via github action --- .github/workflows/deploy.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..a412c28 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,43 @@ +--- +name: 'deploy' + +# yamllint disable-line rule:truthy +on: + # onl run this workflow on pull request events + pull_request + +jobs: + review_app: + runs-on: ubuntu-latest + # only run when a pull request is opened + if: github.event_name == 'pull_request' && github.event.action == 'opened' + steps: + - name: Cloning repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Push to dokku + uses: dokku/github-action@master + with: + # create a review app + command: review-apps:create + git_remote_url: 'ssh://dokku@dokku.com/nginx-buildpack' + # specify a name for the review app + review_app_name: nginx-buildpack-${{ github.event.pull_request.number }} + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} + + destroy_review_app: + runs-on: ubuntu-latest + # only run when a pull request is closed + if: github.event_name == 'pull_request' && github.event.action == 'closed' + steps: + - name: Destroy the review app + uses: dokku/github-action@master + with: + # destroy a review app + command: review-apps:destroy + git_remote_url: 'ssh://dokku@dokku.me:22/nginx-buildpack' + # specify a name for the review app + review_app_name: nginx-buildpack-${{ github.event.pull_request.number }} + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}