Use npm ci instead of install #7
Workflow file for this run
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
# github action to deploy subscriber sls service to prod | |
name: Deploy subscriber service to prod | |
on: | |
push: | |
branches: | |
- main | |
- gh-actions | |
paths: | |
- subscriber/** | |
- .github/workflows/sls-subscriber.yaml | |
env: | |
SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }} | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ vars.AWS_REGION }} | |
- name: Install Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '18.x' | |
- name: Install serverless framework | |
run: npm install -g serverless | |
- name: Install node dependencies | |
working-directory: subscriber | |
run: npm ci | |
- name: Install python3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Package and deploy | |
working-directory: subscriber | |
run: | | |
serverless deploy \ | |
--region ${{ vars.AWS_REGION }} \ | |
--org ${{ vars.SLSORG }} \ | |
--app ${{ vars.SLSAPP }} \ | |
--stage ${{ vars.SLSSTAGE }} \ | |
--verbose |