Merge pull request #274 from nc2U/dependabot/pip/deploy/docker/python… #26
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
name: Image [web:python] Update | |
on: | |
push: | |
paths: | |
- "deploy/docker/python/**" | |
branches: [ "master" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# job은 사용자가 정한 플랫폼을 통해 steps 라는 일련의 과정을 실행. | |
# 여러 개의 job 을 사용할 수 있으며, 여러 개의 job 을 사용할 때는 서로 정보도 교환 가능. | |
# 각각 독립적으로도 실행 가능. | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
# 레파지터리 체크 아웃 | |
- name: Check out source code | |
uses: actions/checkout@v3 | |
# 도커 허브 로그인 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Web image 변화가 있으면 빌드 및 푸시 | |
- name: Web image push Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: "deploy/docker/python" | |
push: true | |
tags: pikube/web:latest | |
# slack --> notification | |
- name: Send slack when failed | |
if: ${{ failure() }} # 실패했을 때 실행 | |
uses: ./.github/actions/slack-notify # 직접 '만든' Action이므로 uses 키워드를 이용해서 아래 경로를 입력해줍니다. | |
with: | |
slack_incoming_url: ${{ secrets.SLACK_INCOMING_URL }} | |
- name: Send slack if completed | |
if: ${{ success() }} # 성공할 때만 실행 | |
uses: ./.github/actions/slack-notify | |
with: | |
status: success # status input은 받는 쪽에서 default 값을 정해놨기 때문에 success일 때만 전달. | |
slack_incoming_url: ${{ secrets.SLACK_INCOMING_URL }} |