채용 페이지 > 교육 매니저 JD 추가 #114
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
name: CI/CD development | |
on: | |
push: | |
branches: [develop] | |
env: | |
CACHED_DEPENDENCY_PATHS: ./node_modules | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: develop | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- name: Compute dependency cache key | |
id: compute_lockfile_hash | |
run: echo "::set-output name=hash::${{ hashFiles('package-lock.json') }}" | |
- name: Check dependency cache | |
uses: actions/cache@v2 | |
id: cache_dependencies | |
with: | |
path: ${{ env.CACHED_DEPENDENCY_PATHS }} | |
key: develop-${{ steps.compute_lockfile_hash.outputs.hash }} | |
- name: Install dependencies if cache not exist | |
if: steps.cache_dependencies.outputs.cache-hit != 'true' | |
run: npm install | |
- name: Run test | |
run: npm run test | |
outputs: | |
dependency_cache_key: develop-${{ steps.compute_lockfile_hash.outputs.hash }} | |
staging-deploy: | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: develop | |
fetch-depth: 0 | |
- name: Check dependency cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ env.CACHED_DEPENDENCY_PATHS }} | |
key: ${{ needs.test.outputs.dependency_cache_key }} | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- name: Build gatsby application | |
run: npm run build | |
- name: Build storybook | |
run: npm run build-storybook | |
- name: Publish to Chromatic | |
uses: chromaui/action@v1 | |
with: | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
storybookBuildDir: storybook-static | |
workingDir: ./ | |
- name: Declare commit id use on s3 upload | |
id: vars | |
shell: bash | |
run: | | |
echo "GITHUB_SHA: ${GITHUB_SHA}" | |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | |
- name: AWS S3 Deploy | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read --follow-symlinks --delete | |
env: | |
AWS_S3_BUCKET: beta.codesquad.kr | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: "ap-northeast-2" | |
SOURCE_DIR: "./public" | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
fields: repo,commit,message,author,action,ref | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} |