WIP: atempt to use the gradlew in the set directory #30
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 | |
on: | |
push: | |
branches: | |
- main | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{github.repository}} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test PostService | |
working-directory: ./PostManagement | |
run: ./gradlew test | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- dockerfile: ./UserService/Dockerfile | |
image: ghcr.io/AleksandraKrasteva/user-service | |
working-directory: ./UserService | |
- dockerfile: ./JourneyService/Dockerfile | |
image: ghcr.io/AleksandraKrasteva/journey-service | |
working-directory: ./JourneyService | |
- dockerfile: ./PostManagement/Dockerfile | |
image: ghcr.io/AleksandraKrasteva/post-service | |
working-directory: ./PostManagement | |
- dockerfile: ./StatisticsService/Dockerfile | |
image: ghcr.io/AleksandraKrasteva/statistics-service | |
working-directory: ./StatisticsService | |
- dockerfile: ./client/Dockerfile | |
image: ghcr.io/AleksandraKrasteva/client | |
working-directory: ./client | |
- dockerfile: ./Dockerfile | |
image: ghcr.io/AleksandraKrasteva/rabbitmq | |
working-directory: ./ | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Log in Docker GitHub Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Extract metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{matrix.image}} | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Build and push images from matrix | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{matrix.working-directory}} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |