Create key #5
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: Build-and-Release" | |
| concurrency: | |
| group: ${{ github.head_ref }}-charts-website-release | |
| on: | |
| workflow_call: | |
| workflow_dispatch: | |
| #pull_request: | |
| # paths: | |
| # - "charts/**" | |
| # - "website/**" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "website/**" | |
| - ".github/workflows/website.yaml" | |
| # Use `bash --noprofile --norc -exo pipefail` by default for all `run` steps in this workflow: | |
| # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaultsrun | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| check_changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changes_detected: ${{ steps.filter.outputs.changed }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: Filter paths | |
| id: filter | |
| uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 | |
| with: | |
| list-files: json | |
| filters: | | |
| changed: | |
| - 'website/**' | |
| release-website: | |
| permissions: | |
| pull-requests: write | |
| name: "${{ github.ref == 'refs/heads/master' && '(Production)' || '(Preview)' }}" | |
| runs-on: ubuntu-latest | |
| needs: check_changes | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Comment deploy start | |
| if: github.event_name != 'push' && needs.check_changes.outputs.changes_detected == 'true' | |
| continue-on-error: true | |
| uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 | |
| with: | |
| message-id: cloudflare-deploy | |
| message: | | |
| ### π§ Deploy Preview building... | |
| | Name | Link | | |
| |---------------------|-------------------------------------------------------------------------------| | |
| |π¨ Latest commit | ${{ github.sha }} | | |
| |π Latest deploy log | https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | | |
| --- | |
| - name: Publish to Cloudflare Pages | |
| if: needs.check_changes.outputs.changes_detected == 'true' | |
| id: cloudflare | |
| continue-on-error: true | |
| uses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca # v1 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| # By default Cloudflare marks `main` as the "production" branch. | |
| # So when this workflow is pushed to refs/heads/main, we set the branch to `main`/"production". | |
| branch: ${{ github.ref == 'refs/heads/main' && 'main' || github.head_ref }} | |
| # The project name in Cloudflare | |
| projectName: trueforge-website | |
| directory: ./website | |
| wranglerVersion: "3" | |
| - name: Comment deploy url | |
| if: github.event_name != 'push' && needs.check_changes.outputs.changes_detected == 'true' | |
| continue-on-error: true | |
| uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 | |
| with: | |
| message-id: cloudflare-deploy | |
| message: | | |
| ### β Deploy Preview ready! | |
| | Name | Link | | |
| |----------------------|-------------------------------------------------------------------------------| | |
| |π¨ Latest commit | ${{ github.sha }} | | |
| |π Latest deploy log | https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | | |
| |π Deploy Preview Url | [${{ steps.cloudflare.outputs.url }}](${{ steps.cloudflare.outputs.url }}) | | |
| |π³ Environment | ${{ steps.cloudflare.outputs.environment }} | | |
| --- | |
| - name: Release-and-Website Completed | |
| if: needs.check_changes.outputs.changes_detected == 'true' | |
| run: echo "DONE" |