Skip to content

Updated the path to the roles config #2

Updated the path to the roles config

Updated the path to the roles config #2

Workflow file for this run

name: Build and Push Docker Image
# Trigger the workflow on push to main branch or pull requests
on:
push:
branches:
- development
pull_request:
branches:
- development
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Set up Docker Buildx (required for multi-stage builds)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Step 3: Set up Node.js and jq (for JSON parsing)
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install jq (JSON parser)
run: sudo apt-get update && sudo apt-get install -y jq
# Step 4: Extract platform information from roles-config.json
- name: Extract platform from roles-config.json
id: extract_platform
run: |
PLATFORM=$(jq -r '.baseUrl.platform' ./server/src/main/resources/roles-config.json)
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV
# Step 5: Build and tag the Docker image
- name: Build and tag Docker image
run: |

Check failure on line 43 in .github/workflows/docker-build.yml

View workflow run for this annotation

GitHub Actions / Build and Push Docker Image

Invalid workflow file

The workflow is not valid. .github/workflows/docker-build.yml (Line: 43, Col: 14): Unrecognized named-value: 'DOCKERHUB_PASSWORD'. Located at position 1 within expression: DOCKERHUB_PASSWORD
DOCKERHUB_USERNAME="${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_PASSWORD="${{ secrets.DOCKERHUB_PASSWORD }}"
REPOSITORY_NAME="openchanjo_gateway"
IMAGE_TAG="${DOCKERHUB_USERNAME}/${REPOSITORY_NAME}:${{ env.PLATFORM }}"
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