Skip to content

Develop

Develop #2

Workflow file for this run

# name of the workflow
name: Heroku
# run workflow when the condition is met
on:
# run when code is pushed on the `main` branch
push:
branches: ["*"]
# run when a pull request to the `main` branch
pull_request:
branches: ["*"]
# env variables
env:
CARGO_TERM_COLOR: always
# jobs
jobs:
# job name
build:
# os to run the job on support macOS and windows also
runs-on: ubuntu-latest
# steps for job
steps:
# this will get the code and set the git
- uses: actions/checkout@v3
# run the build
- name: Set up Elm
run: |
ELM_URL="https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz"
curl -L -o elm.gz $ELM_URL
gunzip elm.gz
chmod +x elm
sudo mv elm /usr/local/bin/
- name: Build Frontend
run: |
cd ./web && sh ./build.sh
- name: Build Server
# using cargo to build
run: cargo build --release
# for deployment
- name: make dir
# create a directory
run: mkdir app
# put the app in it
- name: copy
run: cp ./target/release/exhibit ./app/exhibit && cp -r ./webroot ./app/webroot
# heroku deployment
- uses: akhileshns/[email protected]
with:
# key from repository secrets
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
# name of the Heroku app
heroku_app_name: "exhibit"
# email from which the app is uploaded
heroku_email: "[email protected]"
# app directory
appdir: "./app"
# start command
procfile: "web: ./exhibit"
# buildpack is like environment used to run the app
buildpack: "https://github.com/ph3nx/heroku-binary-buildpack.git"