-
Notifications
You must be signed in to change notification settings - Fork 36
chore: add v2 docs publish github action #3604
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ on: | |
| - main | ||
| - next | ||
| - dev | ||
| - docs | ||
|
|
||
| # Allows you to run this workflow manually from the Actions tab | ||
| workflow_dispatch: | ||
|
|
@@ -20,11 +21,11 @@ jobs: | |
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: "24" | ||
|
|
||
|
|
@@ -60,3 +61,72 @@ jobs: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| run: npx nx affected --target release --parallel=false --base=${{ steps.last_successful_commit.outputs.base }} | ||
|
|
||
| - name: Install oc CLI | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add |
||
| uses: redhat-actions/openshift-tools-installer@v1 | ||
| with: | ||
| oc: latest | ||
|
|
||
| - name: Oc login | ||
| uses: redhat-actions/oc-login@v1 | ||
| with: | ||
| # URL to your OpenShift cluster. | ||
| # Refer to Step 2. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which step 2 we refer in this comment? |
||
| openshift_server_url: ${{ secrets.ARO_SERVER }} | ||
| openshift_token: ${{ secrets.ARO_TOKEN }} | ||
|
|
||
| # Optional - this sets your Kubernetes context's current namespace after logging in. | ||
| namespace: ui-components-build | ||
|
|
||
| - name: Start Build | ||
|
|
||
| if: github.ref == 'refs/heads/docs' | ||
|
|
||
| run: | | ||
| oc patch bc/ui-components -p '{"spec":{"output":{"to":{"kind":"ImageStreamTag","name":"design-system-docs:latest"}}}}' | ||
| cp docs/Dockerfile dist/docs/ | ||
| cp docs/nginx.conf dist/docs/ | ||
| oc start-build ui-components --from-dir dist/docs --follow --wait | ||
|
|
||
| publishDocs: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| if: github.ref == 'refs/heads/docs' | ||
|
|
||
| needs: build | ||
|
|
||
| environment: | ||
| name: Prod | ||
|
|
||
| steps: | ||
| - name: Install oc CLI | ||
| uses: redhat-actions/openshift-tools-installer@v1 | ||
| with: | ||
| oc: latest | ||
|
|
||
| - name: Oc login | ||
| uses: redhat-actions/oc-login@v1 | ||
| with: | ||
| # URL to your OpenShift cluster. | ||
| # Refer to Step 2. | ||
| openshift_server_url: ${{ secrets.ARO_SERVER }} | ||
| openshift_token: ${{ secrets.ARO_TOKEN }} | ||
|
|
||
| # Disables SSL cert checking. Use this if you don't have the certificate authority data. | ||
| insecure_skip_tls_verify: true | ||
| # This method is more secure, if the certificate from Step 4 is available. | ||
| # certificate_authority_data: ${{ secrets.CA_DATA }} | ||
|
|
||
| # Optional - this sets your Kubernetes context's current namespace after logging in. | ||
| namespace: ui-components-build | ||
|
|
||
| - name: Create ImageStream | ||
| run: oc get imagestream design-system-docs || oc create imagestream design-system-docs | ||
|
|
||
| - name: Tag Prod | ||
| run: oc tag design-system-docs:latest design-system-docs:prod | ||
|
|
||
| - name: Publish docs | ||
| run: | | ||
| oc project ui-components-prod | ||
| oc rollout latest dc/design-system-docs | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| FROM registry.access.redhat.com/ubi9/nginx-124 | ||
|
|
||
| COPY . /usr/share/nginx/html | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is wrong. Currently in the Also with this, the |
||
|
|
||
| CMD nginx -g "daemon off;" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| events { | ||
| worker_connections 1024; | ||
| } | ||
| http{ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a small space between |
||
| sendfile on; | ||
| include mime.types; | ||
| default_type application/octet-stream; | ||
|
|
||
| server { | ||
|
|
||
| listen 4203; | ||
|
ArakTaiRoth marked this conversation as resolved.
|
||
| root /opt/app-root/src; | ||
| index index.html; | ||
|
|
||
|
|
||
| location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add |
||
| expires 1d; | ||
| add_header Cache-Control "public, no-transform"; | ||
| } | ||
|
|
||
| location / { | ||
| gzip on; | ||
| try_files $uri /index.html; | ||
| } | ||
| } | ||
| } | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.