Skip to content

Commit

Permalink
feat(dx): Add release GitHub Action (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kohei Asai authored Mar 20, 2021
1 parent e970d47 commit 1aff3b2
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release
on:
push:
branches:
- master
jobs:
dry-build:
name: Dry Build
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA: ${{ github.sha }}
NEXT_PUBLIC_GRAPHCMS_ENDPOINT: ${{ secrets.E2E_GRAPHCMS_ENDPOINT }}
NEXT_PUBLIC_SIMPLE_LOCALIZE_TOKEN: ${{ secrets.E2E_SIMPLE_LOCALIZE_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14'
- name: Restore/cache npm packages
uses: actions/cache@v2
env:
cache-name: cache-npm-packages
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install npm packages
run: npm ci
- name: Dry Build
run: npm run build
e2e-test:
name: E2E Test
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA: ${{ github.sha }}
NEXT_PUBLIC_GRAPHCMS_ENDPOINT: ${{ secrets.E2E_GRAPHCMS_ENDPOINT }}
NEXT_PUBLIC_SIMPLE_LOCALIZE_TOKEN: ${{ secrets.E2E_SIMPLE_LOCALIZE_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14'
- uses: microsoft/playwright-github-action@v1
- name: Restore/cache npm packages
uses: actions/cache@v2
env:
cache-name: cache-npm-packages
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install npm packages
run: npm ci
- name: Run E2E tests
run: npx start-server-and-test "npm run build && npx next start" "http://localhost:3000" "npm run e2e-test -- --ci --verbose"
release:
name: Release
runs-on: ubuntu-latest
needs: [dry-build, e2e-test]
steps:
- uses: actions/checkout@v2
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: npx --package semantic-release semantic-release

2 comments on commit 1aff3b2

@vercel
Copy link

@vercel vercel bot commented on 1aff3b2 Mar 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kohei-dev – ./

kohei-dev-axross.vercel.app
kohei-dev.now.sh
kohei-dev-git-master-axross.vercel.app
www.kohei.dev

@vercel
Copy link

@vercel vercel bot commented on 1aff3b2 Mar 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.