Add some debugging to the CI build #265
Workflow file for this run
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
name: CI-Build | |
on: [push] | |
jobs: | |
verify: | |
name: Verify | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Verify with Maven | |
run: mvn -B verify --file pom.xml | |
id: maven-verify | |
- name: Extract release info | |
run: | | |
artifact=`grep "<artifactId" pom.xml | head -n 1 | awk -F"<artifactId>" '{print $2}' | awk -F "</artifactId" '{print $1}'` | |
version=`grep "<version" pom.xml | head -n 1 | awk -F"<version>" '{print $2}' | awk -F "</version" '{print $1}'` | |
version_tag=$artifact-$version-$branch-$GITHUB_SHA | |
echo "Image version tag: $version_tag" | |
echo $version_tag > image_tags | |
cat image_tags | |
- name: Remove target dir | |
run: | | |
rm -rf target | |
- name: Verify image tags | |
run: | | |
ls -talh image_tags | |
cat image_tags | |
# - name: Send code to S3 | |
# env: | |
# AWS_S3_CODE_BUCKET: ${{ secrets.AWS_S3_CODE_BUCKET }} | |
# run: | | |
# echo $GITHUB_REPOSITORY | |
# echo $GITHUB_SHA | |
# echo $GITHUB_SHA > release | |
# if test "$GITHUB_REF" = "refs/heads/main"; then | |
# echo "Branch is main - no need to make a release name..." | |
# branch="main" | |
# else | |
# echo "Making a release name for non-main branch..." | |
# branch=`echo $GITHUB_REF | awk -F '/' '{print $3}'` | |
# release_name=`echo $GITHUB_ACTOR-$branch` | |
# echo "Release name: $release_name" | |
# echo $release_name > release_name | |
# fi | |
# artifact=`grep "<artifactId" pom.xml | head -n 1 | awk -F"<artifactId>" '{print $2}' | awk -F "</artifactId" '{print $1}'` | |
# version=`grep "<version" pom.xml | head -n 1 | awk -F"<version>" '{print $2}' | awk -F "</version" '{print $1}'` | |
# version_tag=$artifact-$version-$branch-$GITHUB_SHA | |
# echo "Image version tag: $version_tag" | |
# echo $version_tag > image_tags | |
# zip -r app.zip . --exclude=*target* | |
# repo_slug=`echo $GITHUB_REPOSITORY | awk -F '/' '{print $2}'` | |
# echo $repo_slug | |
# aws s3 cp app.zip s3://$AWS_S3_CODE_BUCKET/$repo_slug.zip | |
aws-upload: | |
needs: verify | |
if: needs.verify.result == 'success' | |
uses: arup-group/actions-city-modelling-lab/.github/workflows/aws-upload.yml@main | |
secrets: inherit | |
slack-notify-ci: | |
needs: verify | |
if: always() | |
uses: arup-group/actions-city-modelling-lab/.github/workflows/slack-notify.yml@main | |
secrets: inherit | |
with: | |
result: ${{needs.verify.result}} | |
channel: city-modelling-feeds | |
message: CI build |