attempt to set docker environemnt #34
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: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Change wrapper permissions | |
working-directory: ./PostManagement | |
run: chmod +x ./gradlew | |
- name: build PostService | |
working-directory: ./PostManagement | |
run: ./gradlew build | |
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 }} | |