Skip to content

Remove heroku links #24

Remove heroku links

Remove heroku links #24

Workflow file for this run

name: Release
on:
push:
branches:
- master
- main
env:
HEROKU_STAGING_APP_NAME: nestjs-starter-staging
HEROKU_PRODUCTION_APP_NAME: nestjs-starter-production
concurrency:
group: ${{ github.ref }}-release
jobs:
build-and-push-image-to-heroku:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx to be able to use caching
uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
registry: registry.heroku.com
username: _
password: ${{ secrets.HEROKU_API_KEY }}
- name: Docker build
uses: docker/build-push-action@v2
with:
push: true
tags: registry.heroku.com/${{ env.HEROKU_STAGING_APP_NAME }}/web,registry.heroku.com/${{ env.HEROKU_PRODUCTION_APP_NAME }}/web
file: Dockerfile.prod
cache-from: type=gha
cache-to: type=gha
deploy-staging:
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.ref == 'refs/heads/master' && github.repository_owner == 'thisismydesign'
needs: [build-and-push-image-to-heroku]
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
steps:
- name: Run release command
run: heroku container:release web -a ${{ env.HEROKU_STAGING_APP_NAME }}
test-e2e-staging:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [deploy-staging]
steps:
- uses: actions/checkout@v2
- name: Cypress run
uses: cypress-io/github-action@v4
with:
wait-on: 'https://nestjs-starter-staging.herokuapp.com'
wait-on-timeout: 120
config-file: cypress.staging.config.ts
- name: Save Cypress artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-artifacts-staging
path: |
cypress/videos
cypress/screenshots
deploy-production:
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.ref == 'refs/heads/master' && github.repository_owner == 'thisismydesign'
needs: [build-and-push-image-to-heroku, test-e2e-staging]
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
steps:
- name: Run release command
run: heroku container:release web -a ${{ env.HEROKU_PRODUCTION_APP_NAME }}
test-e2e-production:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [deploy-production]
steps:
- uses: actions/checkout@v2
- name: Cypress run
uses: cypress-io/github-action@v4
with:
wait-on: 'https://nestjs-starter-production.herokuapp.com'
wait-on-timeout: 120
config-file: cypress.production.config.ts
- name: Save Cypress artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-artifacts-production
path: |
cypress/videos
cypress/screenshots