기타 주제

Github actions 관련 정보

jw92 2022. 9. 15. 18:01
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the "main" branch
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v3

      # Runs a single command using the runners shell
      - name: Run a one-line script
        run: echo Hello, world!

      # Runs a set of commands using the runners shell
      - name: Run a multi-line script
        run: |
          echo Add other actions to build,
          echo test, and deploy your project.

1. checkout은 branch에서 코드를 내려받는 것. https://github.com/actions/checkout

 - 기본적으로 제일 앞에 넣어주는 경우가 대부분

 - 다른 branch 등에서 코드를 받는 것도 가능

2. on - push에서 tags와 branch가 main refs. 이 2가지만 or 조건이다.

 - 이 2가지 중 뭐로 trigger되었는지 actions contexts 에서 확인 가능
( https://docs.github.com/en/actions/learn-github-actions/contexts )

 - branch와 paths는 and 조건

'기타 주제' 카테고리의 다른 글

Java의 Slf4j, Logging Framework와 Dependency  (1) 2024.09.02
Maven / Gradle의 Dependencies Conflicts  (1) 2024.09.02
piix4smbus: Host SMbus controller not enabled  (0) 2022.10.05
Lex 와 Yacc  (0) 2021.04.12