Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add GHA for PR previews through Surge #106

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

HarshCasper
Copy link
Member

Description

This PR adds a GHA Action to deploy preview PRs on Surge for easy reviews.

JIRA ID: https://issues.redhat.com/browse/RHDEVDOCS-3339

Copy link
Contributor

@jc-berger jc-berger left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Nov 3, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: HarshCasper, jc-berger

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@themr0c
Copy link
Collaborator

themr0c commented Nov 10, 2021

I fear it does not work when the PR originates from a forked repository: it won't have access to the SURGE_TOKEN environment variable, because it's a secret available only from the main repository context. Can you proofcheck it?

We had that issue in the che-docs repository, and we solved it as following:

  1. A workflow on pull_request, running in the context of the fork, does the build and stores an artifact. See:https://github.com/eclipse/che-docs/blob/master/.github/workflows/build-and-validate-on-pr.yaml
  2. A workflow on workflow_run, running in the context of the main repository, retrieves the artifact and does the publication using the main repository secret. See: https://github.com/eclipse/che-docs/blob/master/.github/workflows/publish-netlify.yml

@themr0c
Copy link
Collaborator

themr0c commented Nov 10, 2021

I created a SURGE_TOKEN repository token in this repository, using the free account linked to my email address.

@themr0c
Copy link
Collaborator

themr0c commented Nov 10, 2021

Consider adding the teardown: 'true' option.

@themr0c
Copy link
Collaborator

themr0c commented Nov 10, 2021

Failing check, probably because the fork doesn't have access to the SURGE_TOKEN secret. See #106 (comment)

@HarshCasper
Copy link
Member Author

Hi @themr0c

I have added the Surge Token from my personal account on my fork. I will re-trigger the CI for it to run.

@openshift-ci
Copy link

openshift-ci bot commented Nov 11, 2021

New changes are detected. LGTM label has been removed.

@openshift-ci openshift-ci bot removed the lgtm label Nov 11, 2021
@HarshCasper
Copy link
Member Author

Hi @themr0c @rkratky

The Surge deployed link is available here: devfile-docs-preview-pr-106.surge.sh

The CI fails due to the resources not being available by integration (the GitHub token in my case). In my opinion, it is fit to be merged in the current state and we can check if the Surge deploys the next PR preview.

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.

4 participants