Skip to content

Commit 28177fb

Browse files
committed
New deployment approach
1 parent 4e16b97 commit 28177fb

File tree

1 file changed

+21
-29
lines changed

1 file changed

+21
-29
lines changed

.github/workflows/heroku-deploy.yml

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,27 @@
1-
name: Push Container to Heroku
2-
1+
name: Deploy # The name of the workflow
32
on:
43
push:
54
branches:
6-
- main
7-
5+
- main #Launch the action on every push on the branch main
86
jobs:
97
build:
10-
runs-on: ubuntu-latest
8+
runs-on: ubuntu-latest # Setup an environment to run the action
119
steps:
12-
- uses: actions/checkout@v2
13-
- name: Check Heroku Version
14-
env:
15-
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
16-
run: heroku --version
17-
- name: Login to Heroku Container registry
18-
env:
19-
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
20-
run: heroku container:login
21-
- name: Add remote origin
22-
run: |
23-
git remote add heroku https://heroku:${{ secrets.HEROKU_API_KEY }}@git.heroku.com/djangosnippets.git
24-
- name: Check branches
25-
env:
26-
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
27-
run: git fetch --all --unshallow
28-
- name: Pull
29-
run: |
30-
git branch
31-
- name: Deploy to Heroku
32-
run: |
33-
git push heroku main
34-
env:
35-
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
10+
- uses: actions/checkout@v2 # This actions copy the repository on the environment
11+
- uses: akhileshns/[email protected] # This action deploys the content on Heroku
12+
with:
13+
heroku_api_key: ${{secrets.HEROKU_API_KEY}} #The Heroku api key we stored on our repo secret
14+
heroku_app_name: "YOUR_HEROKU_APP" #The name of your heroku app - Must be unique in Heroku
15+
heroku_email: "[email protected]" #Your heroku yuser name
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+

0 commit comments

Comments
 (0)