Skip to content

Add Connect deploy workflows with PR previews - #81

Merged
tdstein merged 2 commits into
mainfrom
connect-deploy
Aug 5, 2026
Merged

Add Connect deploy workflows with PR previews#81
tdstein merged 2 commits into
mainfrom
connect-deploy

Conversation

@tdstein

@tdstein tdstein commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds .github/workflows/deploy.yml: sends the app to two Connect servers (dev and staging) using posit-dev/connect-actions. A push to main sends the real, live version. A pull request sends a draft preview instead, and posts a comment with the preview link.
  • Adds .github/workflows/cleanup-previews.yml: deletes the draft previews from both servers when a pull request closes.
  • The two server addresses are stored as GitHub secrets (CONNECT_SERVER_DEV, CONNECT_SERVER_STAGING) instead of being written directly in the workflow file. This keeps them out of a plain GitHub search. It does not fully hide them, though: the deploy step still posts the real address in its pull request comment (see below).
  • Login uses Trusted Publishing (OIDC), so no API key is stored. Each app needs a trusted publisher set up for this repo on its Access tab in Connect.
  • Fixes the shinychat remote in DESCRIPTION: the R package actually lives in the pkg-r folder of that repo. The old remote pointed at the wrong spot, so it quietly used the CRAN version (0.4.0) instead, which is missing chat_server.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Preview deployed to Connect (dogfood.team.pct.posit.it): https://dogfood.team.pct.posit.it/connect/#/apps/d7a36cae-8f27-448b-a478-61b81fbe3942/draft/358565

Deployed from commit db46a57.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Preview deployed to Connect (connect.staging.pct.posit.it): https://connect.staging.pct.posit.it/connect/#/apps/ad662e1b-5048-4acc-9ad7-f9478c92274e/draft/1654

Deployed from commit db46a57.

Adds GitHub Actions workflows to deploy the app to Posit Connect
(dev and staging) via posit-dev/connect-actions, with PR draft
previews and preview cleanup on PR close. Connect server URLs are
read from the CONNECT_SERVER_DEV / CONNECT_SERVER_STAGING repo
secrets rather than hardcoded.
Comment thread inst/manifest.json

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add this to Rbuildignore so that it doesn't ship with the package?

@simonpcouch simonpcouch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, let's do this! A couple things to address before merge:

  • What happens if I make PR A, then PR B, then want to look at the preview for PR A? In other words, is the deployed preview per-branch or per-repo?
  • When I click '"Back to active version"', am I actually seeing the most recent deployed preview or am I seeing some previous version of the content, pre-deploy-preview for the given PR?
  • Could you add Sara, Garrick, and Carson as viewers of these pages as well?

Noting for them that, for now, there seems to be a Connect issue where, after clicking the link, you will see a page that says you don't have access to the listing. Click "Back to active version" and then you'll see the page.

@tdstein

tdstein commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author
  • What happens if I make PR A, then PR B, then want to look at the preview for PR A? In other words, is the deployed preview per-branch or per-repo?

It's per branch, so each PR get's their own unique build on Connect!

When I click '"Back to active version"', am I actually seeing the most recent deployed preview or am I seeing some previous version of the content, pre-deploy-preview for the given PR?

Technically, it's the most recent deployed version, but moving forward that will be whatever is on main once this change lands.

Could you add Sara, Garrick, and Carson as viewers of these pages as well?

Done!

Deploy-time manifest.json is used by connect-actions, not by the R package build.
@tdstein
tdstein merged commit 4eae41d into main Aug 5, 2026
2 checks passed
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Cleaned up 3 preview bundle(s) on https://dogfood.team.pct.posit.it: 358249, 358545, 358565

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Cleaned up 3 preview bundle(s) on https://connect.staging.pct.posit.it: 1640, 1649, 1654

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants