-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
fd5e33d
commit 1abb5d3
Showing
5 changed files
with
82 additions
and
67 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
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Deploy | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
description: Version to deploy | ||
required: true | ||
type: string | ||
|
||
env: | ||
HEROKU_REGISTRY_TOKEN: ${{ secrets.HEROKU_REGISTRY_TOKEN }} | ||
JAVA_DISTRIBUTION: zulu | ||
JAVA_VERSION: 21 | ||
|
||
jobs: | ||
deploy: | ||
runs-on: [ ubuntu-latest ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
cache: gradle | ||
distribution: ${{ env.JAVA_DISTRIBUTION }} | ||
java-version: ${{ env.JAVA_VERSION }} | ||
ref: ${{ inputs.version }} | ||
|
||
- name: Login to Heroku Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
password: ${{ env.HEROKU_REGISTRY_TOKEN }} | ||
registry: registry.heroku.com | ||
username: _ | ||
|
||
- name: Push image to Heroku registry | ||
run: ./gradlew dockerPushHerokuProduction | ||
|
||
- name: Trigger release | ||
shell: bash | ||
run: | | ||
export IMAGE_ID=$(docker inspect registry.heroku.com/chucky/web --format={{.Id}}) | ||
curl -X PATCH \ | ||
https://api.heroku.com/apps/chucky/formation \ | ||
-H 'Accept: application/vnd.heroku+json; version=3.docker-releases' \ | ||
-H "Authorization: Bearer ${HEROKU_REGISTRY_TOKEN}" \ | ||
-H 'Content-Type: application/json' \ | ||
-d "{\"updates\":[{\"type\":\"web\",\"docker_image\":\"${IMAGE_ID}\"}]}" |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Build and deploy | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
version: ${{ github.sha }} | ||
|
||
deploy: | ||
needs: build | ||
secrets: inherit | ||
uses: ./.github/workflows/deploy.yml | ||
with: | ||
version: ${{ github.sha }} |
This file was deleted.
Oops, something went wrong.
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