-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Matias Schilling
committed
Nov 23, 2023
1 parent
84f6c13
commit d2943cf
Showing
3 changed files
with
55 additions
and
155 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# GitHub Actions documentation | ||
# => https://docs.github.com/en/actions | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
|
||
unit-test: | ||
if: "!contains(github.event.head_commit.message, 'skip-ci')" | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
cache: 'gradle' | ||
- run: | | ||
./gradlew test | ||
release: | ||
if: "!contains(github.event.head_commit.message, 'skip-ci')" | ||
needs: [ unit-test ] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
cache: 'gradle' | ||
- name: Login to Heroku Docker Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
password: ${{ secrets.HEROKU_REGISTRY_TOKEN }} | ||
registry: registry.heroku.com | ||
username: _ | ||
- name: 'Push image to Heroku registry' | ||
run: ./gradlew dockerPushHerokuProduction | ||
- name: Trigger release | ||
shell: bash | ||
env: | ||
HEROKU_REGISTRY_TOKEN: ${{ secrets.HEROKU_REGISTRY_TOKEN }} | ||
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