MissKatyPyro/.github/workflows/deploy.yml
2023-02-24 17:42:44 +07:00

33 lines
1.1 KiB
YAML

name: Deploying to heroku
on: workflow_dispatch
env:
IMAGE_NAME: worker
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 }}