CodeBlanks Logo Icon CodeBlanks

Summary - Actions workflow

Combine the workflow parts to build a robust CI.

Modern CI/CD workflow architecture

A robust GitHub Actions pipeline combines speed, security, and multi-environment support. matrix tests code across all target platforms and versions, while actions/cache preserves dependencies to slash build durations. Credentials are encrypted and safely injected using secrets.

jobs:
  test:
    strategy:
      matrix:
        node: [18, 20]
    steps:
      - uses: actions/cache@v4
      - env:
          KEY: ${{ secrets.API_KEY }}

Combining these three pillars yields an enterprise-grade CI/CD pipeline.

Practice Complete deploy step with secret

Add the name: Dagitim step with KEY: ${{ secrets.DEPLOY_KEY }} under env: and run: echo "Dagitim tamam".

Starter code

terminal
cat << 'EOF' > .github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node: [18, 20]
    steps:
      - uses: actions/checkout@v4
      # deploy adimini buraya ekle
EOF

cat .github/workflows/ci.yml

Sample solution

terminal
cat << 'EOF' > .github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node: [18, 20]
    steps:
      - uses: actions/checkout@v4
      - name: Dagitim
        env:
          KEY: ${{ secrets.DEPLOY_KEY }}
        run: echo "Dagitim tamam"
EOF

cat .github/workflows/ci.yml

Expected output

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node: [18, 20]
    steps:
      - uses: actions/checkout@v4
      - name: Dagitim
        env:
          KEY: ${{ secrets.DEPLOY_KEY }}
        run: echo "Dagitim tamam"

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which trio of features is used to build a fast, secure, multi-platform deployment pipeline?

  • matrix, actions/cache, and secrets Correct answer
  • git status, git diff, and git add
  • git rebase, git merge, and git reset
  • git stash, git pop, and git clean

Explanation: Matrix enables multi-version testing, cache provides speed, and secrets ensures secure credential management in modern CI pipelines.

2 Keep other matrix jobs on failure

Question
    strategy:
      ____: false
Answer
    strategy:
      fail-fast: false

Explanation: false ensures other matrix variations keep running even if one matrix job fails.

3 Workflow building blocks

Term Meaning
matrix stratejisi Provides multi-runtime environments
Önbellek (cache) Cuts down package download time
Gizli anahtarlar Protects sensitive data encrypted
Actions boru hattı Automated test and deploy pipeline

All lessons in Advanced