본문으로 건너뛰기

Action

1 action

  • Marketplace에서 사람들이 정의한 action을 그대로 가져와 나의 workflow에서 실행할 수 있다.

2 Checkout

예시

- name: Checkout Argocd Repo
uses: actions/checkout@v3
with:
repository: 'OOM-DEV/backend-argocd'
token: '${{ secrets.GIT_HUB_TOKEN }}'

3 Add & Commit

예시

- name: Commit Changes
uses: EndBug/add-and-commit@v9
with:
author_name: github-action-bot
author_email: nameks@naver.com
add: oom-deployment.yaml
message: 'Update image tag to ${{ github.ref_name }}'

4 GitHub Push

  • The GitHub Actions for pushing to GitHub repository local changes authorizing using GitHub token.

예시

- name: Push Changes
uses: ad-m/github-push-action@v0.6.0
with:
repository: 'OOM-DEV/backend-argocd'
branch: main
github_token: ${{ secrets.GIT_HUB_TOKEN }}

Inputs

namevaluedefaultdescription
github_tokenstring${{ github.token }}GITHUB_TOKEN or a repo scoped Personal Access Token.
sshbooleanfalseDetermines if ssh/ Deploy Keys is used.
branchstring(default)Destination branch to push changes. Can be passed in using ${{ github.ref }}.
forcebooleanfalseDetermines if force push is used.
force_with_leasebooleanfalseDetermines if force-with-lease push is used. Please specify the corresponding branch inside ref section of the checkout action e.g. ref: ${{ github.head_ref }}.
atomicbooleantrueDetermines if atomic push is used.
tagsbooleanfalseDetermines if --tags is used.
directorystring'.'Directory to change to before pushing.
repositorystring''Repository name. Default or empty repository name represents current github repository. If you want to push to other repository, you should make a personal access token and use it as the github_token input.

5 Setup Java JDK

예시

- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17

6 Docker Build & Push Action

예시


- name: Build and Push Docker Image
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: $DOCKER_IMAGE_NAME
tags: ${{ github.ref_name }}
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}