Skip to content

Commit

Permalink
Use GitHub actions for build
Browse files Browse the repository at this point in the history
  • Loading branch information
Matias Schilling committed Nov 23, 2023
1 parent 84f6c13 commit d2943cf
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 155 deletions.
154 changes: 0 additions & 154 deletions .circleci/config.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/release.yml
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}\"}]}"
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ tasks {
tag("current", "${imageName}:${appVer}")
tag("latest", "${imageName}:latest")
tag("herokuProduction", "registry.heroku.com/chucky/web")
tag("herokuStaging", "registry.heroku.com/chucky-staging/web")

dockerfile file("${projectDir}/src/main/docker/Dockerfile")
files tasks.bootJar.outputs
Expand Down

0 comments on commit d2943cf

Please sign in to comment.