Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 72 additions & 2 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
- next
- dev
- docs
Comment thread
ArakTaiRoth marked this conversation as resolved.

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -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"

Expand Down Expand Up @@ -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
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.

Should we add if: github.ref === 'refs/heads/docs like line 83?

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.
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.

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
5 changes: 5 additions & 0 deletions docs/Dockerfile
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
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.

I think this is wrong. Currently in the nginx.conf, you're pointing to /opt/app-root/src, while here you're copying everything into /usr/share/nginx/html. So this should probably be changed to the same folder used in the nginx.conf. Also would be a good idea to make that directory the WORKDIR.

Also with this, the nginx.conf is being copied here as well, not into the the actual configuration directory, so I don't think it'll be loaded and run properly. I'm not sure what the configuration directory is though on our server, /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx


CMD nginx -g "daemon off;"
26 changes: 26 additions & 0 deletions docs/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
events {
worker_connections 1024;
}
http{
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.

Maybe add a small space between http and {

sendfile on;
include mime.types;
default_type application/octet-stream;

server {

listen 4203;
Comment thread
ArakTaiRoth marked this conversation as resolved.
root /opt/app-root/src;
index index.html;


location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
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.

Should we add svg, woff, woff2, ttf too

expires 1d;
add_header Cache-Control "public, no-transform";
}

location / {
gzip on;
try_files $uri /index.html;
}
}
}
22 changes: 0 additions & 22 deletions nginx.conf

This file was deleted.

Loading