37
loading...
This website collects cookies to deliver better user experience
shiny-example
, if available, this will create theHEROKU_EMAIL
and HEROKU_API_KEY
as repository secrets:.github/workflows/deploy.yml
file in the example repositoryshiny-example
) that was set up
in the Heroku dashboard previously,appdir
variable to e.g. app1
, this is the
directory the script will use to find the Shiny files relative to
the Dockerfile
in the root of this directory.name: Build Shiny Docker Image and Deploy to Heroku
on:
push:
branches:
- main
jobs:
app1:
name: Build and deploy Shiny app
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build and push Docker to Heroku
uses: akhileshns/heroku-[email protected]
with:
heroku_app_name: shiny-example
appdir: "."
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_email: ${{ secrets.HEROKU_EMAIL }}
usedocker: true
on
sectionmain
branch. Next, you have the description of the jobs, including theapp1
job are:akhileshns/heroku-deploy
GitHub action.name: Build Shiny Docker Image and Deploy to Heroku
on:
push:
branches:
- main
jobs:
app1:
name: Build and deploy Shiny app
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build and push Docker to Heroku
env:
HEROKU_APP_NAME: shiny-example
DOCKERFILE_DIRECTORY: "."
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
DOCKERFILE_NAME: "Dockerfile"
DOCKER_OPTIONS: "--no-cache"
run: |
cd ${DOCKERFILE_DIRECTORY}
echo ${HEROKU_API_KEY} | docker login \
--username=${HEROKU_EMAIL} \
registry.heroku.com \
--password-stdin
docker build \
--file ${DOCKERFILE_NAME} \
${DOCKER_OPTIONS} \
--tag registry.heroku.com/${HEROKU_APP_NAME}/web .
heroku container:push web --app ${HEROKU_APP_NAME}
heroku container:release web --app ${HEROKU_APP_NAME}