Skip to content

Deploy a test website per pull request instead of beta.habrasanta.org #39

Deploy a test website per pull request instead of beta.habrasanta.org

Deploy a test website per pull request instead of beta.habrasanta.org #39

Workflow file for this run

name: Build the pull request and deploy it on habrasanta.org
on:
pull_request:
permissions:
contents: read
deployments: write
concurrency:
group: pull-request-${{ github.event.number }}-deployment
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: ${{ env.DOMAIN }}

Check failure on line 14 in .github/workflows/beta.yaml

View workflow run for this annotation

GitHub Actions / Build the pull request and deploy it on habrasanta.org

Invalid workflow file

The workflow is not valid. .github/workflows/beta.yaml (Line: 14, Col: 13): Unrecognized named-value: 'env'. Located at position 1 within expression: env.DOMAIN
url: https://${{ env.DOMAIN }}
env:
DOMAIN: pull-request-${{ github.event.number }}.habrasanta.org
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm ci
- run: npm run build
env:
NODE_ENV: production
- name: Deploy to ${{ env.DOMAIN }}
run: |
mkdir ~/.ssh
echo "${{ vars.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
eval `ssh-agent`
echo "$SSH_PRIVATE_KEY" | ssh-add -
rsync --recursive --verbose dist/ [email protected]:/var/www/${{ env.DOMAIN }}
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Check if the URL is accessible
run: curl --fail https://${{ env.DOMAIN }}