Web publishing
Put the website or web app in your project live, connect a domain, see what happens on each submission and go back to a previous version.
Your website and web app go live in the same flow as the rest of your project. A developer submits their work; PVersion builds it, uploads it to the site and puts it live over a secure connection (https). You don't rent a server or move files by hand. Say Can refreshes the home page of Atlas's website and submits it; shortly after, the new page is live.
What you can publish
- Static site: plain HTML, or sites built with React, Vue and the like.
- PHP: Laravel, WordPress and similar.
- Node.js app: the app starts with
app.js; only thepublic/folder is open to the outside.
The build (for example npm ci && npm run build or composer install --no-dev) runs on PVersion's server; nothing runs on your computer. PHP and Node.js sites can also get a MySQL database. Its address, user and password sit on the server, in a file of the site that can't be opened from outside; the How does your code connect? link on the site card shows the PHP and Node.js lines to add to your code. Nobody needs to know the password or write it into the code.
How many websites you can publish depends on your plan (see Plans and payment).
Setting up publishing
Web publishing is set up as a service, just like Builds. The PVersion team sets it up; when this permission is turned on, the studio's admins can do it too. Open a case from the Support page of the console and tell us:
- Which folder of the project holds the site (every submission to that folder triggers a release).
- The kind of site: static, PHP or Node.js.
- The build command and the folder to publish, if any (for example the build output
dist). - The domain: a ready address or your own domain. If you need a database, say so too.
Once set up, the site shows on the Services & deployments page of the console.
Domain and certificate
Every site can go live on a ready address (for example atlas.app.pversion.com); you don't need to do anything for it.
To connect your own domain (for example www.example.com), one DNS record is enough:
- Open the site's service page in the console. On the site card, the Domain DNS record box shows the record to add: its type (usually
A, sometimesCNAME), name and value. Use the copy button next to the value. - Add this record in the DNS panel of the company you bought the domain from.
- Once the record has spread (usually a few minutes), PVersion sees it and gets the certificate by itself. To look right away, press Check now.
What the box can say:
| Status | What to do |
|---|---|
| record not visible yet | If you added the record, wait for it to spread |
| not pointed yet | The domain points to another address; fix the record. If you use Cloudflare, make the record's cloud grey (DNS only) |
| an old IPv6 record remains | Delete the old AAAA record in the DNS panel |
The certificate comes from Let's Encrypt and renews by itself before it expires; the card says "Let's Encrypt · renews automatically". If a certificate can't be issued, the card says why in one sentence, and Details opens the full text.
What happens on each submission
- A submission reaches the site's folder (see Submitting).
- PVersion takes that version of the project and runs the build command, if there is one.
- The folder to publish is uploaded to the site. Only new and changed files go up; files an earlier release put there that are no longer in the project are removed. Files the site creates itself (visitors' uploads, caches) are left alone.
- The new version is live, and earlier ones stay in the list as previous version.
Files that may hold passwords or keys (such as .env, .pem, .key) are not uploaded to a public folder, and the release's log names the ones skipped. In a Node.js app, a .env outside public/ is uploaded because the web cannot open it. On a PHP site, .env is uploaded because the app may read it, and the log warns about it; check that its address does not open.
The Deployments list on the service page shows every release: queued, syncing, building, uploading, live or failed. Click a row to open its Steps log, where you see which files went up and, if something failed, why. If the build step fails, nothing is uploaded and the site keeps serving the previous version.
Going back to a previous version
Every release is kept on record. If something is wrong with the new version:
- Open the Deployments list on the service page.
- Press the roll-back button on the right of the previous version row you want.
- Write a Note if you like (for example "contact form broken") and confirm.
That version is uploaded again and becomes live. To repeat a failed release, use Retry on its row.
Ask the assistant on the site or write to [email protected].
PVersion