Skip to content

Commit

Permalink
Updated the path to the roles config
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnjau committed Nov 7, 2024
1 parent 85c6587 commit dd2edec
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,17 @@ jobs:
- name: Extract platform from roles-config.json
id: extract_platform
run: |
PLATFORM=$(jq -r '.baseUrl.platform' ./roles-config.json)
PLATFORM=$(jq -r '.baseUrl.platform' ./server/src/main/resources/roles-config.json)
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV
# Step 5: Log in to Docker Hub using credentials from GitHub secrets
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

# Step 6: Build and tag the Docker image
# Step 5: Build and tag the Docker image
- name: Build and tag Docker image
run: |
DOCKERHUB_USERNAME="${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_PASSWORD="${{ secrets.DOCKERHUB_PASSWORD }}"
REPOSITORY_NAME="openchanjo_gateway"
IMAGE_TAG="${DOCKERHUB_USERNAME}/${REPOSITORY_NAME}:${{ env.PLATFORM }}"
docker buildx build --platform linux/amd64 -t $IMAGE_TAG .
# Step 7: Push the image to Docker Hub
- name: Push Docker image
run: |
DOCKERHUB_USERNAME="${{ secrets.DOCKERHUB_USERNAME }}"
REPOSITORY_NAME="openchanjo_gateway"
IMAGE_TAG="${DOCKERHUB_USERNAME}/${REPOSITORY_NAME}:${{ env.PLATFORM }}"
docker push $IMAGE_TAG
echo '${{ DOCKERHUB_PASSWORD }}' | docker login -u ${{ DOCKERHUB_USERNAME }} --password-stdin
docker buildx create --use --name workflowBuilder
docker buildx build --platform=linux/amd64,linux/arm64 -t ${{ env.$IMAGE_TAG }} --push .
docker logout

0 comments on commit dd2edec

Please sign in to comment.