Merge pull request #7 from SPARCS-UP-Mindanao/6-be-fix-certifcate-gen… #13
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 SPARCS Certificate Service | |
on: | |
push: | |
branches: | |
- main | |
- stage | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-southeast-1 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python3 -m pip install pipenv==2023.4.29 | |
pipenv install | |
- name: Install Serverless Framework | |
run: | | |
npm install | |
npm install -g serverless | |
- name: Deploy with Serverless | |
run: | | |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
sls deploy --stage prod --verbose | |
elif [[ "${{ github.ref }}" == "refs/heads/stage" ]]; then | |
sls deploy --stage dev --verbose | |
fi |