Merge pull request #356 from GovAlta/alpha #86
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Website Deployment | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v2 | |
| with: | |
| node-version: "22" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| - run: npm ci | |
| - name: Build | |
| env: | |
| VITE_AUTH_TOKEN: ${{ secrets.VITE_AUTH_TOKEN }} | |
| run: | | |
| VITE_AUTH_TOKEN=${{secrets.VITE_AUTH_TOKEN}} npm run build | |
| cp nginx.conf dist/ | |
| - 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: Start Build | |
| run: oc start-build ui-components-docs --from-dir dist --follow --wait | |
| deployProd: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-22.04 | |
| needs: build | |
| environment: | |
| name: Prod | |
| steps: | |
| - 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: Tag Prod | |
| run: oc tag ui-components-docs:latest ui-components-docs:prod | |
| - name: Deploy Prod | |
| run: | | |
| oc project ui-components-prod | |
| oc rollout latest dc/ui-components-docs |