Some bugfixes #386
This file contains hidden or 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
| name: Deploy Preview | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| workflow_dispatch: | |
| branches: [main, development, beta] | |
| push: | |
| branches: [main, beta, development] | |
| jobs: | |
| deploy: | |
| environment: ArcOS | |
| if: github.event.action != 'closed' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Write env file | |
| run: | | |
| echo -e "DW_SERVER_URL=\"https://test.arcapi.nl\"" > .env | |
| echo -e "DW_PREVIEW_DEP_BRANCH=\"${{ github.head_ref || github.ref_name }}\"" >> .env | |
| echo "development" > public/mode | |
| - run: yarn | |
| - run: DW_SERVER_URL="https://test.arcapi.nl" yarn build | |
| - name: Upload build to server | |
| uses: burnett01/rsync-deployments@6.0.0 | |
| with: | |
| switches: -avzr --delete | |
| path: dist/ | |
| remote_path: /var/www/previewsite/www/${{ github.head_ref || github.ref_name }}/ | |
| remote_host: 62.171.184.106 | |
| remote_user: deploy | |
| remote_key: | | |
| ${{ secrets.SSH_KEY }} | |
| - name: Comment preview link | |
| if: ${{ github.event_name == 'pull_request' }} | |
| uses: thollander/actions-comment-pull-request@v3 | |
| with: | |
| message: "✅ Preview deployment is ready: https://team.arcweb.nl/previews/framed/${{ github.head_ref }}" |