-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy a test website per pull request instead of beta.habrasanta.org
- Loading branch information
Showing
1 changed file
with
13 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
name: Build the dev branch and deploy it to beta.habrasanta.org | ||
name: Build the pull request and deploy it on habrasanta.org | ||
on: | ||
workflow_run: | ||
workflows: | ||
- Test each and every commit | ||
branches: | ||
- dev | ||
types: | ||
- completed | ||
pull_request: | ||
permissions: | ||
contents: read | ||
deployments: write | ||
concurrency: | ||
group: deploy | ||
cancel-in-progress: false | ||
group: pull-request-${{ github.event.number }}-deployment | ||
cancel-in-progress: true | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
environment: | ||
name: pull-request-${{ github.event.number }} | ||
url: https://pull-request-${{ github.event.number }}.habrasanta.org | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
|
@@ -27,4 +26,6 @@ jobs: | |
echo "${{vars.SSH_KNOWN_HOSTS}}" > ~/.ssh/known_hosts | ||
eval `ssh-agent` | ||
echo "${{secrets.SSH_PRIVATE_KEY}}" | ssh-add - | ||
rsync --recursive --verbose dist/ [email protected]:/var/www/beta.habrasanta.org | ||
rsync --recursive --verbose dist/ [email protected]:/var/www/pull-request-${{ github.event.number }}.habrasanta.org | ||
- name: Check if the URL is accessible | ||
run: curl --fail https://pull-request-${{ github.event.number }}.habrasanta.org |