mirror of
				https://github.com/jakejarvis/jarv.is.git
				synced 2025-11-04 10:30:11 -05:00 
			
		
		
		
	deploy to Vercel
This commit is contained in:
		
							
								
								
									
										100
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										100
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							@@ -1,100 +0,0 @@
 | 
			
		||||
name: CI
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  push:
 | 
			
		||||
    branches:
 | 
			
		||||
    - main
 | 
			
		||||
  pull_request:
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  deploy:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    # "[skip ci]" also causes Netlify to skip, so these are automatically in harmony
 | 
			
		||||
    # https://docs.netlify.com/site-deploys/manage-deploys/#skip-a-deploy
 | 
			
		||||
    if: "github.actor == 'jakejarvis' && !contains(github.event.head_commit.message, '[skip ci]')"
 | 
			
		||||
    timeout-minutes: 20
 | 
			
		||||
    steps:
 | 
			
		||||
    - name: Wait for Netlify
 | 
			
		||||
      # installing via `npx` each run takes a long time, but deploys always take longer
 | 
			
		||||
      run: npx netlify-cli watch
 | 
			
		||||
      env:
 | 
			
		||||
        NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
 | 
			
		||||
        NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
 | 
			
		||||
 | 
			
		||||
  audit:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    needs: deploy
 | 
			
		||||
    env:
 | 
			
		||||
      LHCI_TOKEN: ${{ secrets.LHCI_TOKEN }}
 | 
			
		||||
      LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
 | 
			
		||||
    steps:
 | 
			
		||||
    - uses: actions/checkout@v2
 | 
			
		||||
      with:
 | 
			
		||||
        fetch-depth: 2
 | 
			
		||||
        lfs: false
 | 
			
		||||
    - uses: actions/setup-node@v2
 | 
			
		||||
      with:
 | 
			
		||||
        node-version: 16.x
 | 
			
		||||
    - name: Install LHCI
 | 
			
		||||
      run: npm install -g @lhci/cli
 | 
			
		||||
    - name: Check LHCI
 | 
			
		||||
      run: |
 | 
			
		||||
        lhci --version
 | 
			
		||||
        lhci healthcheck
 | 
			
		||||
    - name: Audit deploy preview
 | 
			
		||||
      if: "github.event_name == 'pull_request'"
 | 
			
		||||
      continue-on-error: true
 | 
			
		||||
      run: |
 | 
			
		||||
        lhci autorun \
 | 
			
		||||
          --collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.app/ \
 | 
			
		||||
          --collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.app/notes/how-to-pull-request-fork-github/
 | 
			
		||||
    - name: Audit production site
 | 
			
		||||
      if: "github.event_name == 'push' && github.ref == 'refs/heads/main'"
 | 
			
		||||
      continue-on-error: true
 | 
			
		||||
      run: |
 | 
			
		||||
        lhci autorun \
 | 
			
		||||
          --collect.url=https://jarv.is/ \
 | 
			
		||||
          --collect.url=https://jarv.is/notes/how-to-pull-request-fork-github/
 | 
			
		||||
    - name: Upload results as artifact
 | 
			
		||||
      uses: actions/upload-artifact@v2
 | 
			
		||||
      if: success()
 | 
			
		||||
      with:
 | 
			
		||||
        name: lhci-results
 | 
			
		||||
        path: ./.lighthouseci
 | 
			
		||||
 | 
			
		||||
  lint:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    if: "!contains(github.event.head_commit.message, '[skip ci]')"
 | 
			
		||||
    steps:
 | 
			
		||||
    - uses: actions/checkout@v2
 | 
			
		||||
      with:
 | 
			
		||||
        fetch-depth: 1
 | 
			
		||||
        lfs: false
 | 
			
		||||
    - uses: actions/setup-node@v2
 | 
			
		||||
      with:
 | 
			
		||||
        node-version: 16.x
 | 
			
		||||
    - name: Get Yarn cache path
 | 
			
		||||
      # https://github.com/actions/cache/blob/master/examples.md#node---yarn
 | 
			
		||||
      # https://github.com/actions/cache/issues/60
 | 
			
		||||
      id: yarn-cache
 | 
			
		||||
      run: echo "::set-output name=dir::$(yarn cache dir)"
 | 
			
		||||
    - name: Cache dependencies
 | 
			
		||||
      uses: actions/cache@v2
 | 
			
		||||
      with:
 | 
			
		||||
        path: ${{ steps.yarn-cache.outputs.dir }}
 | 
			
		||||
        key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
 | 
			
		||||
        restore-keys: |
 | 
			
		||||
          ${{ runner.os }}-yarn-
 | 
			
		||||
    - name: Install dependencies
 | 
			
		||||
      run: yarn install --no-ignore-optional --frozen-lockfile
 | 
			
		||||
    - name: Audit dependencies
 | 
			
		||||
      run: yarn audit || true
 | 
			
		||||
      continue-on-error: true
 | 
			
		||||
    - name: Build preview
 | 
			
		||||
      run: yarn build:hugo --environment development --baseURL / --buildDrafts --buildFuture
 | 
			
		||||
    - name: Lint
 | 
			
		||||
      run: yarn lint
 | 
			
		||||
    - name: Percy snapshots
 | 
			
		||||
      uses: percy/snapshot-action@v0.1.2
 | 
			
		||||
      env:
 | 
			
		||||
        PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
 | 
			
		||||
							
								
								
									
										71
									
								
								.github/workflows/codeql-analysis.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										71
									
								
								.github/workflows/codeql-analysis.yml
									
									
									
									
										vendored
									
									
								
							@@ -1,71 +0,0 @@
 | 
			
		||||
# For most projects, this workflow file will not need changing; you simply need
 | 
			
		||||
# to commit it to your repository.
 | 
			
		||||
#
 | 
			
		||||
# You may wish to alter this file to override the set of languages analyzed,
 | 
			
		||||
# or to provide custom queries or build logic.
 | 
			
		||||
#
 | 
			
		||||
# ******** NOTE ********
 | 
			
		||||
# We have attempted to detect the languages in your repository. Please check
 | 
			
		||||
# the `language` matrix defined below to confirm you have the correct set of
 | 
			
		||||
# supported CodeQL languages.
 | 
			
		||||
#
 | 
			
		||||
name: "CodeQL"
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  push:
 | 
			
		||||
    branches: [ main ]
 | 
			
		||||
  pull_request:
 | 
			
		||||
    # The branches below must be a subset of the branches above
 | 
			
		||||
    branches: [ main ]
 | 
			
		||||
  schedule:
 | 
			
		||||
    - cron: '41 7 * * 6'
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  analyze:
 | 
			
		||||
    name: Analyze
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    permissions:
 | 
			
		||||
      actions: read
 | 
			
		||||
      contents: read
 | 
			
		||||
      security-events: write
 | 
			
		||||
 | 
			
		||||
    strategy:
 | 
			
		||||
      fail-fast: false
 | 
			
		||||
      matrix:
 | 
			
		||||
        language: [ 'javascript' ]
 | 
			
		||||
        # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
 | 
			
		||||
        # Learn more:
 | 
			
		||||
        # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
    - name: Checkout repository
 | 
			
		||||
      uses: actions/checkout@v2
 | 
			
		||||
 | 
			
		||||
    # Initializes the CodeQL tools for scanning.
 | 
			
		||||
    - name: Initialize CodeQL
 | 
			
		||||
      uses: github/codeql-action/init@v1
 | 
			
		||||
      with:
 | 
			
		||||
        languages: ${{ matrix.language }}
 | 
			
		||||
        # If you wish to specify custom queries, you can do so here or in a config file.
 | 
			
		||||
        # By default, queries listed here will override any specified in a config file.
 | 
			
		||||
        # Prefix the list here with "+" to use these queries and those in the config file.
 | 
			
		||||
        # queries: ./path/to/local/query, your-org/your-repo/queries@main
 | 
			
		||||
 | 
			
		||||
    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
 | 
			
		||||
    # If this step fails, then you should remove it and run the build manually (see below)
 | 
			
		||||
    - name: Autobuild
 | 
			
		||||
      uses: github/codeql-action/autobuild@v1
 | 
			
		||||
 | 
			
		||||
    # ℹ️ Command-line programs to run using the OS shell.
 | 
			
		||||
    # 📚 https://git.io/JvXDl
 | 
			
		||||
 | 
			
		||||
    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
 | 
			
		||||
    #    and modify them (or add more) to build your code if your project
 | 
			
		||||
    #    uses a compiled language
 | 
			
		||||
 | 
			
		||||
    - run: |
 | 
			
		||||
       yarn install --no-ignore-optional --frozen-lockfile
 | 
			
		||||
       yarn build:functions
 | 
			
		||||
 | 
			
		||||
    - name: Perform CodeQL Analysis
 | 
			
		||||
      uses: github/codeql-action/analyze@v1
 | 
			
		||||
							
								
								
									
										15
									
								
								.github/workflows/purge-artifacts.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								.github/workflows/purge-artifacts.yml
									
									
									
									
										vendored
									
									
								
							@@ -1,15 +0,0 @@
 | 
			
		||||
name: Purge old artifacts
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  schedule:
 | 
			
		||||
  - cron: '0 9 * * 3'   # every Wednesday at 9 AM UTC == 5 AM EDT
 | 
			
		||||
  workflow_dispatch:
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  purge-artifacts:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
    - uses: kolpav/purge-artifacts-action@v1
 | 
			
		||||
      with:
 | 
			
		||||
        token: ${{ secrets.GITHUB_TOKEN }}
 | 
			
		||||
        expire-in: 0
 | 
			
		||||
		Reference in New Issue
	
	Block a user