workflow changes #79
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 For Concept Microservice | |
on: | |
push: | |
branches: [ version-upgrade ] | |
pull_request: | |
branches: [ version-upgrade ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: { dir: [ | |
'core-banking-service', | |
'internet-banking-fund-transfer-service', | |
'internet-banking-user-service', | |
'internet-banking-utility-payment-service', | |
'internet-banking-service-registry', | |
'internet-banking-api-gateway' | |
] } | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 | |
- name: Build | |
run: ./gradlew build -x test | |
working-directory: ${{ matrix.dir }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.dir }}-artifacts | |
path: | | |
${{ matrix.dir }}/build/libs/${{ matrix.dir }}*SNAPSHOT.jar | |
${{ matrix.dir }}/Dockerfile | |
${{ matrix.dir }}/wait-for-it.sh | |
retention-days: 1 | |
overwrite: true | |
docker_publish: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: { dir: [ | |
'core-banking-service', | |
'internet-banking-fund-transfer-service', | |
'internet-banking-user-service', | |
'internet-banking-utility-payment-service', | |
'internet-banking-service-registry', | |
'internet-banking-api-gateway' | |
] } | |
permissions: | |
contents: read | |
needs: build | |
steps: | |
- name: Download latest build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ matrix.dir }}-artifacts | |
- name: Move artifacts to the correct directory | |
shell: bash | |
run: | | |
ls -lrt | |
mkdir -p ${{ matrix.dir }}-downloaded-artifacts | |
mv build ${{ matrix.dir }}-downloaded-artifacts | |
mv Dockerfile ${{ matrix.dir }}-downloaded-artifacts | |
mv wait-for-it.sh ${{ matrix.dir }}-downloaded-artifacts | |
ls -lrt | |
# - name: Test | |
# run: ls -lrt | |
# working-directory: ${{ matrix.dir }} | |
# | |
# - name: Build Docker image | |
# run: docker build -t ghcr.io/javatodev/${{ matrix.dir }} . | |
# working-directory: ${{ matrix.dir }} | |
# with: | |
# name: ${{ matrix.dir }}-artifacts | |
# | |
# | |
# - name: Build Docker image | |
# run: docker build -t ghcr.io/socialic-v2-0/socialic-connector-service:latest . | |
# | |
# - name: Log in to GitHub Container Registry | |
# run: echo ${{ secrets.DOCKER_ACTION_TOKEN }} | docker login ghcr.io -u chinthaka-dinadasa --password-stdin | |
# | |
# - name: Push Docker image to GitHub Container Registry | |
# run: docker push ghcr.io/socialic-v2-0/socialic-connector-service:latest |