-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
439be22
commit 157214d
Showing
2 changed files
with
13 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,17 @@ | ||
# Your workflow name. | ||
name: Deploy to heroku. | ||
|
||
# Run workflow on every push to dev branch | ||
on: | ||
push: | ||
branches: HW-166-add-tests-to-docker-container | ||
# Your workflows jobs. | ||
name: 'peak-performance' #set whatevername you want to your github job | ||
on: {} # set the events you would like to trigger this job | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Check-out your repository. | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# Copy heroku.yml to the root directory | ||
#Trying to get this file to change so I can make a commit | ||
- name: Copy heroku.yml to root | ||
run: cp ./code/heroku.yml ./ | ||
|
||
# Set up Docker Buildx (optional, but recommended for multi-platform builds) | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
# Install Docker Compose | ||
- name: Install Docker Compose | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install docker-compose -y | ||
# Log in to Docker Hub (if needed, otherwise skip this step) | ||
- name: Log in to Heroku Container Registry | ||
run: echo "${{ secrets.HEROKU_API_KEY }}" | docker login --username=__token__ --password-stdin registry.heroku.com | ||
|
||
# Build and tag Docker images using docker-compose. | ||
- name: Build and Tag Docker Images with Docker Compose | ||
run: | | ||
docker-compose -f ./code/docker-compose-production.yml build | ||
# Tag the Docker images for Heroku | ||
- name: Tag Docker Images | ||
run: | | ||
docker tag registry.heroku.com/peak-performace/api-production:latest registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/api-production:latest | ||
docker tag registry.heroku.com/peak-performace/client-production:latest registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/client-production:latest | ||
# Push Docker images to Heroku Container Registry. | ||
- name: Push Docker Images to Heroku | ||
run: | | ||
docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/api-production:latest | ||
docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/client-production:latest | ||
# Release the Docker images on Heroku. | ||
- name: Release Docker Images on Heroku | ||
run: | | ||
heroku container:release api client --app ${{ secrets.HEROKU_APP_NAME }} | ||
- name: Build, Push and Deploy to Heroku #set the whatever name you want to this step | ||
id: heroku | ||
uses: snithyanantham/[email protected] # use the latest version of the action | ||
with: | ||
app_name: "peak-performace" | ||
email: ${{ secrets.HEROKU_EMAIL }} # your heroku email | ||
api_key: ${{ secrets.HEROKU_API_KEY }} # your heroku api key | ||
docker_compose_file: './code/docker-compose-production.yml' # set the path to the folder where the docker-compose file is located | ||
heroku_apps: '[{"imagename":"api-production","appname":"peak-performace","apptype":"web"},{"imagename":"client-production","appname":"peak-performance","apptype":"web"}]' # List of Docker Image name, Heroku app and Heroku app type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters