Skip to content

Commit

Permalink
New deployment approach
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswedgwood committed Sep 10, 2024
1 parent 4e16b97 commit 28177fb
Showing 1 changed file with 21 additions and 29 deletions.
50 changes: 21 additions & 29 deletions .github/workflows/heroku-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
name: Push Container to Heroku

name: Deploy # The name of the workflow
on:
push:
branches:
- main

- main #Launch the action on every push on the branch main
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-latest # Setup an environment to run the action
steps:
- uses: actions/checkout@v2
- name: Check Heroku Version
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku --version
- name: Login to Heroku Container registry
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login
- name: Add remote origin
run: |
git remote add heroku https://heroku:${{ secrets.HEROKU_API_KEY }}@git.heroku.com/djangosnippets.git
- name: Check branches
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: git fetch --all --unshallow
- name: Pull
run: |
git branch
- name: Deploy to Heroku
run: |
git push heroku main
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
- uses: actions/checkout@v2 # This actions copy the repository on the environment
- uses: akhileshns/[email protected] # This action deploys the content on Heroku
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}} #The Heroku api key we stored on our repo secret
heroku_app_name: "YOUR_HEROKU_APP" #The name of your heroku app - Must be unique in Heroku
heroku_email: "[email protected]" #Your heroku yuser name












0 comments on commit 28177fb

Please sign in to comment.