Skip to content

CD

CD #311

Workflow file for this run

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: Install Heroku CLI
run: |
curl https://cli-assets.heroku.com/install.sh | sh
- name: Checkout for release preparation
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: main
persist-credentials: false
- name: Use Node.js LTS version
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: lts/Jod
- 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@e3eb99d45a8e2ec5dca08735e089607befa4bf28
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: sws2apps
heroku_email: ${{secrets.HEROKU_EMAIL}}