Skip to content

docs: use dynamic version attributes in SwingBridge documentation #149

docs: use dynamic version attributes in SwingBridge documentation

docs: use dynamic version attributes in SwingBridge documentation #149

Workflow file for this run

name: Preview Deploy
on:
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [main]
concurrency:
group: preview-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
FLY_APP: docs-preview-pr-${{ github.event.pull_request.number }}
FLY_ORG: ${{ vars.FLY_ORG || 'personal' }}
jobs:
build-and-deploy:
if: github.event.action != 'closed'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Fly CLI
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Create Fly app (if not exists)
run: |
flyctl apps create "${{ env.FLY_APP }}" --org "${{ env.FLY_ORG }}" 2>/dev/null || true
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Generate fly.toml
run: |
cat > fly.toml <<EOF
app = "${{ env.FLY_APP }}"
primary_region = "ams"
[build]
dockerfile = "Dockerfile.preview"
[http_service]
internal_port = 8210
force_https = true
[[vm]]
size = "shared-cpu-1x"
memory = "256mb"
EOF
- name: Deploy to Fly.io
run: |
flyctl deploy \
--ha=false \
--remote-only \
--build-arg VAADIN_PRO_KEY="${{ secrets.VAADIN_PRO_KEY }}"
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Comment preview URL on PR
uses: marocchino/sticky-pull-request-comment@v2
with:
header: preview-deploy
message: |
### Preview Deployment
This PR has been deployed for preview.
**URL:** https://${{ env.FLY_APP }}.fly.dev
_Built from ${{ github.sha }}_
cleanup:
if: github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Set up Fly CLI
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Destroy Fly app
run: |
flyctl apps destroy "${{ env.FLY_APP }}" --yes 2>/dev/null || true
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}