general updates #3
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: Deploy Production | |
# on master branch updates | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: "18.x" | |
#install serverless | |
- name: Install Serverless Framework | |
run: npm install -g serverless | |
# authentication | |
- name: Serverless AWS authentication | |
run: sls config credentials --provider aws --key ${{ secrets.AWS_KEY_DEPLOY }} --secret ${{ secrets.AWS_SECRET_DEPLOY }} | |
# create ENV, use the shell `cat` command to create env.yml from secrets | |
- name: Create env file | |
run: | | |
cat > env.yml << EOF | |
${{ secrets.ENV }} | |
EOF | |
#install node modules | |
- name: Install NPM dependencies | |
run: npm install | |
#serverless deploy | |
- name: Deploy | |
run: sls deploy -s prod |