Skip to content

CD

CD #247

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: Checkout for release preparation
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: main
persist-credentials: false
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@61680d0e9b02ff86f5648ade99e01be17f0260a4
with:
semantic_version: 19.0.2
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Deploy API to Heroku
if: ${{ steps.semantic.outputs.new_release_published == 'true' }}
uses: akhileshns/heroku-deploy@9fd0f9faae4aa93a38d6f5e25b9128589f1371b0
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: sws2apps
heroku_email: ${{secrets.HEROKU_EMAIL}}