CD #266
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: CD | |
on: | |
workflow_dispatch: | |
permissions: read-all | |
jobs: | |
deploy: | |
name: Deploy API to Production | |
if: ${{ github.repository == 'sws2apps/sws2apps-api' && github.ref == 'refs/heads/main' }} | |
environment: | |
name: Prod.env | |
url: https://api.sws2apps.com | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout for release preparation | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | |
with: | |
ref: main | |
persist-credentials: false | |
- name: Use Node.js LTS version | |
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 | |
with: | |
node-version: lts/Iron | |
- name: Install dependencies | |
run: npm ci | |
- name: Semantic Release | |
id: semantic | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: npx semantic-release | |
- name: Deploy API to Heroku | |
uses: akhileshns/heroku-deploy@581dd286c962b6972d427fcf8980f60755c15520 | |
with: | |
heroku_api_key: ${{secrets.HEROKU_API_KEY}} | |
heroku_app_name: sws2apps | |
heroku_email: ${{secrets.HEROKU_EMAIL}} |