Last active
July 8, 2023 16:46
-
-
Save koistya/c1630bfd265c7013e254fd06b6253c2d to your computer and use it in GitHub Desktop.
GitHub Actions Workflows (example)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub Actions Workflow (example) | |
# .github/workflows/main.yml | |
name: CI/CD | |
on: | |
push: | |
branches: [main] | |
tags: | |
- "v*" | |
pull_request: | |
branches: [main] | |
schedule: | |
- cron: "0 7 * * *" | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: "Environment to deploy to" | |
type: environment | |
default: "test" | |
env: | |
NODE_VERSION: 20 | |
jobs: | |
setup: | |
name: "Setup" | |
runs-on: ubuntu-latest | |
steps: | |
- use: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
id: setup-node | |
with: { node-version: "${{ env.NODE_VERSION }}", cache: "yarn" } | |
- run: yarn install | |
if: steps.setup-node.outputs.cache-hit != 'true' | |
- run: 'echo "Step 1"' | |
- run: 'echo "Step 2"' | |
deploy-a: | |
name: "Deploy A" | |
needs: ["setup"] | |
uses: ./.github/workflows/deploy-a.yml | |
deploy-b: | |
name: "Deploy B" | |
needs: ["setup"] | |
uses: ./.github/workflows/deploy-b.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment