ci: add codecov #119
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
on: | |
push: | |
branches: | |
- master | |
release: | |
types: [released] | |
name: Deploy serverless function | |
jobs: | |
deploy: | |
name: deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: Get environment from event | |
id: environment | |
run: | | |
if '${{ github.event_name == 'release' && github.event.action == 'released' }}' == 'true'; then echo ::set-output name=value::"production"; else echo ::set-output name=value::"dev"; fi | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '14' | |
- run: npm ci --omit=dev --no-optional | |
- name: serverless deploy | |
uses: serverless/[email protected] | |
with: | |
args: deploy --stage ${{ steps.environment.outputs.value }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_SERVERLESS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SERVERLESS_SECRET_ACCESS_KEY }} | |
MISSKEY_INSTANCE: ${{ secrets.MISSKEY_INSTANCE }} | |
MISSKEY_API_TOKEN: ${{ secrets.MISSKEY_API_TOKEN }} | |
MISSKEY_ADMIN: ${{ secrets.MISSKEY_ADMIN }} | |
REDIS_URL: ${{ secrets.REDIS_URL }} |