Skip to content

Commit

Permalink
- add environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
nbarrett committed Sep 21, 2024
1 parent bda646a commit 3db2e88
Showing 1 changed file with 40 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,42 @@ jobs:
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: Build the Docker image
run: docker build . --build-arg CHROME_VERSION=${{ secrets.CHROME_VERSION }} --build-arg CHROMEDRIVER_VERSION=${{ secrets.CHROMEDRIVER_VERSION }} --file Dockerfile --tag ngx-ramblers:${{ github.run_number }}

- name: Tag the Docker image (github run number ${{ github.run_number }})
run: docker tag ngx-ramblers:${{ github.run_number }} ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:${{ github.run_number }}

- name: Push the Docker image to Docker Hub (github run number ${{ github.run_number }})
run: docker push ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:${{ github.run_number }}

- name: Tag the Docker image (latest)
run: docker tag ngx-ramblers:${{ github.run_number }} ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:latest

- name: Push the Docker image to Docker Hub (latest)
run: docker push ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:latest

- name: Install Heroku CLI
run: curl https://cli-assets.heroku.com/install.sh | sh

- name: Log in to Heroku container registry
run: echo "${{ secrets.HEROKU_API_KEY }}" | docker login --username="${{ secrets.HEROKU_EMAIL }}" --password-stdin registry.heroku.com

- name: Tag Docker image for Heroku (github run number ${{ github.run_number }})
run: docker tag ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:${{ github.run_number }} registry.heroku.com/ngx-ramblers-docker:${{ github.run_number }}

- name: Push Docker image to Heroku (github run number ${{ github.run_number }})
run: docker push registry.heroku.com/ngx-ramblers-docker:${{ github.run_number }}

- name: Release Docker image on Heroku (github run number ${{ github.run_number }})
run: heroku container:release ${{ github.run_number }} --app ngx-ramblers-docker

- name: Tag Docker image for Heroku (latest)
run: docker tag ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:${{ github.run_number }} registry.heroku.com/ngx-ramblers-docker:latest

- name: Push Docker image to Heroku (latest)
run: docker push registry.heroku.com/ngx-ramblers-docker:latest

# - name: Build the Docker image
# run: docker build . --build-arg CHROME_VERSION=${{ secrets.CHROME_VERSION }} --build-arg CHROMEDRIVER_VERSION=${{ secrets.CHROMEDRIVER_VERSION }} --file Dockerfile --tag ngx-ramblers:${{ github.run_number }}
#
# - name: Tag the Docker image (github run number ${{ github.run_number }})
# run: docker tag ngx-ramblers:${{ github.run_number }} ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:${{ github.run_number }}
#
# - name: Push the Docker image to Docker Hub (github run number ${{ github.run_number }})
# run: docker push ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:${{ github.run_number }}
#
# - name: Tag the Docker image (latest)
# run: docker tag ngx-ramblers:${{ github.run_number }} ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:latest
#
# - name: Push the Docker image to Docker Hub (latest)
# run: docker push ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:latest
#
# - name: Install Heroku CLI
# run: curl https://cli-assets.heroku.com/install.sh | sh
#
# - name: Log in to Heroku container registry
# run: echo "${{ secrets.HEROKU_API_KEY }}" | docker login --username="${{ secrets.HEROKU_EMAIL }}" --password-stdin registry.heroku.com
#
# - name: Tag Docker image for Heroku (github run number ${{ github.run_number }})
# run: docker tag ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:${{ github.run_number }} registry.heroku.com/ngx-ramblers-docker:${{ github.run_number }}
#
# - name: Push Docker image to Heroku (github run number ${{ github.run_number }})
# run: docker push registry.heroku.com/ngx-ramblers-docker:${{ github.run_number }}
#
# - name: Release Docker image on Heroku (github run number ${{ github.run_number }})
# run: heroku container:release ${{ github.run_number }} --app ngx-ramblers-docker
#
# - name: Tag Docker image for Heroku (latest)
# run: docker tag ${{ secrets.DOCKER_USERNAME }}/ngx-ramblers:${{ github.run_number }} registry.heroku.com/ngx-ramblers-docker:latest
#
# - name: Push Docker image to Heroku (latest)
# run: docker push registry.heroku.com/ngx-ramblers-docker:latest
#
- name: Set environment variables for fly.io deployment
run: |
echo "APP_NAME=${{ secrets.APP_NAME }}" >> $GITHUB_ENV
Expand All @@ -77,10 +77,14 @@ jobs:
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
APP_NAME: ${{ secrets.APP_NAME }}
CHROMEDRIVER_VERSION: ${{ secrets.CHROMEDRIVER_VERSION }}
CHROME_VERSION: ${{ secrets.CHROME_VERSION }}
run: flyctl deploy --remote-only --app $APP_NAME

- name: Scale App to 1
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
APP_NAME: ${{ secrets.APP_NAME }}
CHROMEDRIVER_VERSION: ${{ secrets.CHROMEDRIVER_VERSION }}
CHROME_VERSION: ${{ secrets.CHROME_VERSION }}
run: flyctl scale count 1 --app $APP_NAME

0 comments on commit 3db2e88

Please sign in to comment.