Create deploy.yml

This commit is contained in:
yasirarism 2023-02-24 17:37:53 +07:00 committed by GitHub
parent a6ef59ec4e
commit 0c5dd2369c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

33
.github/workflows/deploy.yml vendored Normal file
View file

@ -0,0 +1,33 @@
name: Deploying to heroku
on: workflow_dispatch
env:
IMAGE_NAME: web
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
CONFIG_FILE_URL: ${{ secrets.CONFIG_FILE_URL }}
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the image
run: docker build . --file Dockerfile -t "${IMAGE_NAME}"
- name: Login into heroku container registry
run: heroku container:login
- name: Create heroku app name
run: heroku create --region eu ${{ secrets.HEROKU_APP_NAME }}
- name: Push the image container to heroku
run: heroku container:push "${IMAGE_NAME}" -a ${{ secrets.HEROKU_APP_NAME }}
- name: Release image to heroku
run: heroku container:release "${IMAGE_NAME}" -a ${{ secrets.HEROKU_APP_NAME }}
- name: Setting up config env
run: heroku config:set CONFIG_FILE_URL="${CONFIG_FILE_URL}" HEROKU_API_KEY="${HEROKU_API_KEY}" HEROKU_APP_NAME="${{ secrets.HEROKU_APP_NAME }}" -a ${{ secrets.HEROKU_APP_NAME }}