use yarn #4
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: Serverless deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
deploy: | |
name: Execute actions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v4 | |
- name: Determine branch name | |
id: branch_name | |
run: | | |
if [ "${{ github.event_name }}" == "pull_request" ]; then | |
echo "STAGE=pr${{ github.event.pull_request.number }}" >> $GITHUB_ENV | |
else | |
echo "STAGE=dev" >> $GITHUB_ENV | |
fi | |
- name: Deploy service | |
env: | |
SERVERLESS_ACCESS_KEY: ${{secrets.SERVERLESS_ACCESS_KEY}} | |
run: | | |
pnpm install | |
pnpm test | |
pnpm sls deploy --stage=$STAGE | |
pnpm test-e2e |