DevOps Classroom notes 28/Jul/2026

Dynamic enviroment variables:

name: Dynamic enviroment

on: 
  push:
    branches: '*'

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v7

      - name: install chart version
        run: |
          echo "BUILD_ID=$(date +%d-%m-%Y)"
         

GITHUB summary:

* to add infromation about your build 
name: Dynamic enviroment

on: 
  push:
    branches: '*'

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v7

      - name: install chart version
        run: |
          echo "BUILD_ID=$(date +%d-%m-%Y)" >> "$GITHUB_ENV"
      - name: print dynamic
        run: |
          echo "###############################################################" >> "$GITHUB_STEP_SUMMARY"
          echo "############## buid name: samplejob############################" >> "$GITHUB_STEP_SUMMARY"
          echo "build started day: ${{ env.BUILD_ID }}" >> "$GITHUB_STEP_SUMMARY"
          echo "######################### END ####################################" >> "$GITHUB_STEP_SUMMARY"
          

combine matrix outputs:


name: test-Matrix

on: 
  push:
    branches: '*'

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      # max-parallel: 2
      matrix:
        os: [ ubuntu-latest, windows-latest]
        node-version: [16, 18]
        exclude:
          - os: windows-latest
            node-version: 18
          - os: ubuntu-latest
            node-version: 16
        include:
          - os: ubuntu-latest
            node-version: 18
          - os: windows-latest
            node-version: 16
    steps:
      - name: checkout
        uses: actions/checkout@v7

      - name: install nodejs
        uses: actions/setup-node@v7
        with:
          node-version: ${{ matrix.node-version }}

     - name: summary for jobs
       run: |
        echo "result ${{ matrix.node-version }} is passed" >> "$GITHUB_STEP_SUMMARY"

TASK

Refer_files: https://github.com/direct-devops/multi-docker-ci.git

create matrix for docker build and publish

# path: front, backend , api 
- name: Build and push
  uses: docker/build-push-action@v6
  with:
    context: ./${{ matrix.path }}
    file: ./${{ matrix.path }}/Dockerfile
    push: true
    tags: user/${{ matrix.path }}:latest

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube