Skip to content

changed image tag

changed image tag #9

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
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
REPOSITORY_NAME: openchanjo_gateway
IMAGE_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/openchanjo_gateway:latest
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: |
echo '${{ env.DOCKERHUB_PASSWORD }}' | docker login -u ${{ env.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