-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dx): Add release GitHub Action (#240)
- Loading branch information
Kohei Asai
authored
Mar 20, 2021
1 parent
e970d47
commit 1aff3b2
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
1aff3b2
There was a problem hiding this comment.
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
1aff3b2
There was a problem hiding this comment.
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-storybook – ./
kohei-dev-storybook.vercel.app
kohei-dev-storybook-axross.vercel.app
kohei-dev-storybook-git-master-axross.vercel.app
storybook.kohei.dev