From 49960fe863c1185cad0e33edd0c91da17dd88ea0 Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Tue, 12 Nov 2024 16:23:57 -0800 Subject: [PATCH] chore: delete unused GHA workflows (#669) --- .github/workflows/build-and-deploy.yml | 94 ------------------------ .github/workflows/push-others.yml | 14 ---- .github/workflows/update-docs-branch.yml | 48 ------------ 3 files changed, 156 deletions(-) delete mode 100644 .github/workflows/build-and-deploy.yml delete mode 100644 .github/workflows/push-others.yml delete mode 100644 .github/workflows/update-docs-branch.yml diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml deleted file mode 100644 index 8435ef7..0000000 --- a/.github/workflows/build-and-deploy.yml +++ /dev/null @@ -1,94 +0,0 @@ -# Reusable workflow for building and deploying the website -# https://docs.github.com/en/actions/learn-github-actions/reusing-workflows -name: Build And Deploy - -on: - workflow_call: - inputs: - branch: - description: 'If we are in "main" or a "version" docs branch' - required: true - type: string - secrets: - SAS: - required: true - -jobs: - build_and_deploy: - name: Build and deploy the website - runs-on: ubuntu-latest - permissions: - actions: read - steps: - - name: Set GIT_BRANCH - run: echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV - - name: Print GIT_BRANCH - run: echo $GIT_BRANCH - - name: Print content - run: ls -ln - - name: Print branch if version - if: ${{ inputs.branch == 'version' }} - run: echo ${{ inputs.branch }} - - name: Print branch if main - if: ${{ inputs.branch == 'main' }} - run: echo ${{ inputs.branch }} - # This should be set up from earlier - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag: v4.2.2 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # tag: v4.0.4 - with: - node-version: 20 - - name: Install dependencies - uses: bahmutov/npm-install@dc9579d3dfb9c0e7a1f56c194eefcb8e2c9f0da5 # tag: v1.10.3 - - name: Lint - run: yarn lint - env: - CI: true - # FIXME: this is stalling - # - name: Download cache - # uses: nick-invision/retry@7152eba30c6575329ac0576536151aca5a72780e # tag: v3.0.0 - # with: - # timeout_seconds: 300 - # max_attempts: 3 - # retry_on: error - # command: ./scripts/bin/azcopy copy "https://electronwebsite.blob.core.windows.net/%24web/*?$SAS" "./build" --recursive - # env: - # SAS: ${{ secrets.SAS }} - - name: Rewrite docs paths if version branch - if: ${{ inputs.branch == 'version' }} - run: node scripts/build-as-doc-version.js $(GIT_BRANCH) - - name: Add Docusaurus problem matcher - run: echo "::add-matcher::.github/problem-matchers/docusaurus.json" - - name: Build default locale site - run: yarn build - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish "/assets" to Storage if version branch - if: ${{ inputs.branch == 'version' }} - uses: nick-invision/retry@7152eba30c6575329ac0576536151aca5a72780e # tag: v3.0.0 - with: - timeout_seconds: 300 - max_attempts: 3 - retry_on: error - command: ./scripts/bin/azcopy copy "./build/assets/*" "https://electronwebsite.blob.core.windows.net/%24web/assets?$SAS" --recursive - env: - SAS: ${{ secrets.SAS }} - - name: Publish "/docs" to Storage if version branch - if: ${{ inputs.branch == 'version' }} - uses: nick-invision/retry@7152eba30c6575329ac0576536151aca5a72780e # tag: v3.0.0 - with: - timeout_seconds: 300 - max_attempts: 3 - retry_on: error - command: ./scripts/bin/azcopy copy "./build/docs/*" "https://electronwebsite.blob.core.windows.net/%24web/docs?$SAS" --recursive - env: - SAS: ${{ secrets.SAS }} - - name: Publish everything to Storage if main branch - if: ${{ inputs.branch == 'main' }} - uses: nick-invision/retry@7152eba30c6575329ac0576536151aca5a72780e # tag: v3.0.0 - with: - timeout_seconds: 300 - max_attempts: 3 - retry_on: error - command: ./scripts/bin/azcopy copy "./build/*" "https://electronwebsite.blob.core.windows.net/%24web/?$SAS" --recursive - env: - SAS: ${{ secrets.SAS }} diff --git a/.github/workflows/push-others.yml b/.github/workflows/push-others.yml deleted file mode 100644 index 8b90123..0000000 --- a/.github/workflows/push-others.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Push and publish version branch - -on: - push: - branches: - - 'v**' - -jobs: - build-and-deploy: - uses: electron/website/.github/workflows/build-and-deploy.yml@main - with: - branch: version - secrets: - SAS: ${{ secrets.SAS }} diff --git a/.github/workflows/update-docs-branch.yml b/.github/workflows/update-docs-branch.yml deleted file mode 100644 index 0db4ff9..0000000 --- a/.github/workflows/update-docs-branch.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: 'Update docs branch' - -on: - repository_dispatch: - types: [doc_changes_branches] - workflow_dispatch: - inputs: - branch: - type: string - description: The branch of the commit, usually something like `15-x-y` - required: true - sha: - type: string - description: The SHA of the `electron/electron` commit - required: true - -permissions: {} - -jobs: - update-docs: - runs-on: ubuntu-latest - environment: docs-updater - steps: - - name: Generate GitHub App token - uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1 - id: generate-token - with: - creds: ${{ secrets.DOCS_UPDATER_GH_APP_CREDS }} - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag: v4.2.2 - with: - token: ${{ steps.generate-token.outputs.token }} - - name: Switch branches - # We switch to the version branch or create a new one if needed - run: git fetch origin && git checkout -t origin/v${{ github.event.client_payload.branch || github.event.inputs.branch }} || git checkout -b v${{ github.event.client_payload.branch || github.event.inputs.branch }} - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # tag: v4.0.4 - with: - node-version: 20 - - name: Install dependencies - uses: bahmutov/npm-install@dc9579d3dfb9c0e7a1f56c194eefcb8e2c9f0da5 # tag: v1.10.3 - - name: Prebuild - run: | - yarn pre-build ${{ github.event.client_payload.sha || github.event.inputs.sha }} - git add . - - name: Push changes - uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0 - with: - message: 'chore: update ref to docs (🤖)' - token: ${{ steps.generate-token.outputs.token }}