Skip to content

Commit

Permalink
Merge pull request #513 from entur/circleci-to-gha-migration
Browse files Browse the repository at this point in the history
Circleci to gha migration
  • Loading branch information
testower authored Jan 2, 2025
2 parents 4109906 + 035d9ca commit e2497bf
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 181 deletions.
124 changes: 0 additions & 124 deletions .circleci/config.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,49 @@ jobs:
sudo timedatectl set-timezone "Europe/Oslo"
mvn --batch-mode jacoco:prepare-agent test jacoco:report -Dprettier.nodePath=node -Dprettier.npmPath=npm
mvn --batch-mode jib:dockerBuild -Dmaven.test.skip -P prettierSkip
image:
# only build and push the image when it's a commit to master in Entur's repository
if: github.repository_owner == 'entur' && github.event_name == 'push'
runs-on: ubuntu-latest
needs: [ tests ]
env:
CONTAINER_REPO: docker.io/entur/uttu
CONTAINER_REGISTRY_USER: ${{ secrets.DOCKERHUB_LOGIN }}
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: maven
- name: set variables
run: |
echo "GHA_DOCKER_PUSH_IMAGE_TAG=`date +%Y-%m-%dT%H-%M`" >> $GITHUB_ENV
- name: Build container image with Jib, push to container repo
run: |
mvn --batch-mode compile com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,${{ env.GHA_DOCKER_PUSH_IMAGE_TAG }} -Dmaven.test.skip -P prettierSkip
- name: Tag default branch with the container image tag ${{ env.GHA_DOCKER_PUSH_IMAGE_TAG }}
id: tag-version
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git tag --annotate "$GHA_DOCKER_PUSH_IMAGE_TAG" -m "chore(tag): $GHA_DOCKER_PUSH_IMAGE_TAG [skip ci]" --force
git push origin "$GHA_DOCKER_PUSH_IMAGE_TAG" --force
- name: Trigger downstream CI
run: |
repo_owner="entur"
repo_name="uttu-deployment-config"
event_type="trigger-downstream-ci"
service="uttu"
echo "Triggering downstream CI for $service with version ${{ env.GHA_DOCKER_PUSH_IMAGE_TAG }}"
curl -X POST \
-H "Authorization: token ${{ secrets.GITFLOW_PAT }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"service\": \"$service\", \"version\": \"$GHA_DOCKER_PUSH_IMAGE_TAG\", \"unit\": false, \"integration\": true}}"
57 changes: 0 additions & 57 deletions .github/workflows/image.yml

This file was deleted.

0 comments on commit e2497bf

Please sign in to comment.