ci: update actions

This commit is contained in:
Thomas Osmonson
2020-07-24 16:30:06 -05:00
committed by Hank Stoever
parent 9ca733f732
commit 3e042b7b1f
4 changed files with 88 additions and 91 deletions

View File

@@ -31,7 +31,7 @@ jobs:
source: 'packages/app/vercel.json'
target: 'packages/app/dist/vercel.json'
- name: Deploy Blockstack App with Vercel
uses: amondnet/vercel-action@v19.0.1+1
- uses: aulneau/vercel-action@v19.0.2+3
id: vercel-deployment-blockstack-app
if: github.event_name == 'pull_request'
with:
@@ -41,6 +41,7 @@ jobs:
scope: ${{ secrets.VERCEL_SCOPE }}
working-directory: packages/app/dist
github-comment: false
alias-domains: pr-{{ PR_NUMBER }}.app.stacks.engineering
- name: Build Blockstack Test App
env:
AUTH_ORIGIN: ${{ steps.vercel-deployment-blockstack-app.outputs.preview-url }}
@@ -52,7 +53,7 @@ jobs:
source: 'packages/test-app/vercel.json'
target: 'packages/test-app/dist/vercel.json'
- name: Deploy Blockstack Test App with Vercel
uses: amondnet/vercel-action@v19.0.1+1
uses: aulneau/vercel-action@v19.0.2+3
id: vercel-deployment-blockstack-test-app
if: github.event_name == 'pull_request'
with:
@@ -62,6 +63,7 @@ jobs:
scope: ${{ secrets.VERCEL_SCOPE }}
working-directory: packages/test-app/dist
github-comment: false
alias-domains: pr-{{ PR_NUMBER }}.testnet-demo.stacks.engineering
- name: Comment on PR
uses: actions/github-script@v2
id: comment
@@ -83,7 +85,7 @@ jobs:
${firstLine}
- [Blockstack App](${{ steps.vercel-deployment-blockstack-app.outputs.preview-url }})
- [Blockstack Test App](${{ steps.vercel-deployment-blockstack-test-app.outputs.preview-url }})
- [Blockstack Testnet Demo App](${{ steps.vercel-deployment-blockstack-test-app.outputs.preview-url }})
Built with commit ${context.sha}.
`;

View File

@@ -1,23 +1,16 @@
name: Deploy UI Docs
on:
push:
branches:
- master
pull_request:
paths:
- packages/ui-docs/**
- packages/ui/**
release:
paths:
- packages/ui-docs/**
- packages/ui/**
jobs:
vercel-deployment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@v19.0.1+1
- uses: aulneau/vercel-action@v19.0.2+3
id: vercel-deployment-preview
if: github.event_name == 'pull_request'
with:
@@ -25,16 +18,7 @@ jobs:
vercel-org-id: ${{ secrets.ORG_ID }}
vercel-project-id: ${{ secrets.PROJECT_ID }}
scope: ${{ secrets.VERCEL_SCOPE }}
working-directory: packages/ui-docs
- uses: amondnet/vercel-action@v19.0.1+1
id: vercel-deployment-production
if: github.event_name == 'push' || github.event_name == 'release'
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID }}
vercel-project-id: ${{ secrets.PROJECT_ID }}
vercel-args: '--prod'
scope: ${{ secrets.VERCEL_SCOPE }}
alias-domains: pr-{{ PR_NUMBER }}.ui.stacks.engineering
working-directory: packages/ui-docs
- name: Comment on PR
uses: actions/github-script@v2

View File

@@ -5,83 +5,83 @@ jobs:
test_keychain:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set Node Version
uses: actions/setup-node@v1.4.2
with:
node-version: 12.16.1
- name: Restore lerna cache
id: lerna-cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install monorepo deps
run: yarn --frozen-lockfile
if: steps.lerna-cache.outputs.cache-hit != 'true'
- name: Keychain tests
run: yarn lerna run test --scope @blockstack/keychain
- name: Checkout
uses: actions/checkout@v2
- name: Set Node Version
uses: actions/setup-node@v1.4.2
with:
node-version: 12.16.1
- name: Restore lerna cache
id: lerna-cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install monorepo deps
run: yarn --frozen-lockfile
if: steps.lerna-cache.outputs.cache-hit != 'true'
- name: Keychain tests
run: yarn lerna run test --scope @blockstack/keychain
codecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set Node Version
uses: actions/setup-node@v1.4.2
with:
node-version: 12.16.1
- name: Restore lerna cache
id: lerna-cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install monorepo deps
run: yarn --frozen-lockfile
if: steps.lerna-cache.outputs.cache-hit != 'true'
- name: Lint
run: yarn lint
- name: Typecheck
run: yarn typecheck
- name: Checkout
uses: actions/checkout@v2
- name: Set Node Version
uses: actions/setup-node@v1.4.2
with:
node-version: 12.16.1
- name: Restore lerna cache
id: lerna-cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install monorepo deps
run: yarn --frozen-lockfile
if: steps.lerna-cache.outputs.cache-hit != 'true'
- name: Lint
run: yarn lint
- name: Typecheck
run: yarn typecheck
publish:
needs: [test_keychain, codecheck]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout master
run: git checkout master
- name: Set Node Version
uses: actions/setup-node@v1.4.2
with:
node-version: 12.16.1
- name: Install monorepo deps (no cache)
run: yarn --frozen-lockfile
if: steps.lerna-cache.outputs.cache-hit != 'true'
- name: Setup .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- name: Setup git
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Lerna Version
run: yarn lerna version --conventional-commits --no-push --yes
- name: Publish
run: yarn lerna publish from-git --conventional-commits --yes
- name: Push changes
uses: ad-m/github-push-action@fe38f0a
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
- name: Checkout master
run: git checkout master
- name: Set Node Version
uses: actions/setup-node@v1.4.2
with:
node-version: 12.16.1
- name: Install monorepo deps (no cache)
run: yarn --frozen-lockfile
if: steps.lerna-cache.outputs.cache-hit != 'true'
- name: Setup .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- name: Setup git
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Lerna Version
run: yarn lerna version --conventional-commits --no-push --yes
- name: Publish
run: yarn lerna publish from-git --conventional-commits --yes
- name: Push changes
uses: ad-m/github-push-action@fe38f0a
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
deploy-prod-apps:
needs: [publish]
@@ -112,7 +112,7 @@ jobs:
with:
source: 'packages/app/vercel.json'
target: 'packages/app/dist/vercel.json'
- uses: amondnet/vercel-action@v19.0.1+1
- uses: amondnet/vercel-action@v19.0.1+2
id: vercel-deployment-app-production
if: github.event_name == 'push' || github.event_name == 'release'
name: Deploy authenticator app to production
@@ -133,7 +133,7 @@ jobs:
with:
source: 'packages/test-app/vercel.json'
target: 'packages/test-app/dist/vercel.json'
- uses: amondnet/vercel-action@v19.0.1+1
- uses: amondnet/vercel-action@v19.0.1+2
id: vercel-deployment-production
name: Deploy test app to production
if: github.event_name == 'push' || github.event_name == 'release'
@@ -144,3 +144,14 @@ jobs:
vercel-args: '--prod'
scope: ${{ secrets.VERCEL_SCOPE }}
working-directory: packages/test-app/dist
- uses: amondnet/vercel-action@v19.0.1+2
id: vercel-deployment-production
if: github.event_name == 'push' || github.event_name == 'release'
name: Deploy UI documentation to production
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID }}
vercel-project-id: ${{ secrets.PROJECT_ID }}
vercel-args: '--prod'
scope: ${{ secrets.VERCEL_SCOPE }}
working-directory: packages/ui-docs

View File

@@ -19,7 +19,7 @@ export async function getStaticProps() {
// we will attempt to re-generate the page:
// - when a request comes in
// - at most once every second
unstable_revalidate: 1,
revalidate: 1,
};
}