Skip to content

Commit

Permalink
Update to latest GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
recrwplay committed Aug 10, 2023
1 parent 5520879 commit a1a1f2c
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 15 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docs-cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "CLA Check"

on:
pull_request_target:
branches:
- main
- dev

jobs:
cla-check:
if: github.event.pull_request.user.login != 'renovate[bot]'

runs-on: ubuntu-latest

env:
PULL_REQUEST_NUMBER: ${{ github.event.number }}
CHECKS_TOKEN: ${{ secrets.DOCS_CHECKS_TOKEN }}

steps:
- uses: actions/checkout@v3
with:
repository: neo-technology/whitelist-check
token: $CHECKS_TOKEN
- uses: actions/setup-python@v4
with:
python-version: 3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run CLA check
shell: bash

run: |
owner=$(echo "$GITHUB_REPOSITORY" | cut -d/ -f1)
repository=$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)
./bin/examine-pull-request "$owner" "$repository" "$CHECKS_TOKEN" "$PULL_REQUEST_NUMBER" cla-database.csv
14 changes: 9 additions & 5 deletions .github/workflows/docs-deploy-surge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,27 @@ jobs:
- id: get-deploy-id
run: |
deployid=$(<deployid)
echo "::set-output name=deploy-id::$deployid"
case "$deployid" in ''|*[!0-9]*) echo "Provided PR number is not an integer"; exit 1 ;; esac
echo "deploy-id=$deployid" >> "$GITHUB_OUTPUT"
- uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Deploy docs to surge
shell: bash
env:
SURGE_TOKEN: "${{ secrets.DOCS_SURGE_TOKEN }}"
run: |
npm install -g surge
surge ./site ${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ steps.get-deploy-id.outputs.deploy-id }}.surge.sh --token ${{ secrets.SURGE_TOKEN }}
surge ./site ${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ steps.get-deploy-id.outputs.deploy-id }}.surge.sh --token "$SURGE_TOKEN"
- name: Comment on PR
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ steps.get-deploy-id.outputs.deploy-id }}
message: |
Looks like you've updated the documentation!
This PR includes documentation updates.
Check out your changes at https://${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ steps.get-deploy-id.outputs.deploy-id }}.surge.sh
GITHUB_TOKEN: ${{ secrets.PR_COMMENT_TOKEN }}
You can view the updated docs at https://${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ steps.get-deploy-id.outputs.deploy-id }}.surge.sh
GITHUB_TOKEN: ${{ secrets.DOCS_PR_COMMENT_TOKEN }}
7 changes: 2 additions & 5 deletions .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ name: "Verify PR"
on:
pull_request:
branches:
- "4.4"
- "5.0"
- "5.x"
- "dev"
- "main"
- main
- dev

jobs:

Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/docs-teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ name: "Documentation Teardown"
on:
pull_request_target:
branches:
- "4.4"
- "5.0"
- "5.x"
- "dev"
- main
- dev
types:
- closed

Expand All @@ -20,6 +18,19 @@ jobs:
with:
node-version: lts/*
- name: Teardown documentation
shell: bash
env:
SURGE_TOKEN: "${{ secrets.DOCS_SURGE_TOKEN }}"
run: |
npm install -g surge
surge teardown ${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ github.event.pull_request.number }}.surge.sh --token ${{ secrets.SURGE_TOKEN }}
surge teardown ${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ github.event.pull_request.number }}.surge.sh --token "$SURGE_TOKEN"
- name: Comment on PR
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ github.event.pull_request.number }}
message: |
Thanks for the documentation updates.
The preview documentation has now been torn down - reopening this PR will republish it.
GITHUB_TOKEN: ${{ secrets.DOCS_PR_COMMENT_TOKEN }}

0 comments on commit a1a1f2c

Please sign in to comment.