Develop to Main λΈλμΉ λκΈ°ν #104
This file contains hidden or 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: Develop to Main λΈλμΉ λκΈ°ν | |
| on: | |
| workflow_dispatch: # μλ μ€ν κ°λ₯ | |
| jobs: | |
| develop-to-main: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: μ μ₯μ 체ν¬μμ | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: develop | |
| - name: Git μ€μ | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: Develop λΈλμΉ λ³κ²½μ¬ν νμΈ λ° λκΈ°ν | |
| run: | | |
| git fetch origin develop | |
| NEW_COMMITS=$(git log --since="@{24 hours ago}" --format="%H" origin/develop) | |
| if [ ! -z "$NEW_COMMITS" ]; then | |
| echo "β¨ develop λΈλμΉμ μλ‘μ΄ μ»€λ°μ΄ λ°κ²¬λμμ΅λλ€." | |
| git checkout main | |
| git pull origin main | |
| git merge origin/develop --no-ff -m "π develop β main μλ λκΈ°ν" | |
| git push origin main | |
| echo "β main λΈλμΉ λκΈ°νκ° μλ£λμμ΅λλ€." | |
| else | |
| echo "π‘ develop λΈλμΉμ μλ‘μ΄ λ³κ²½μ¬νμ΄ μμ΅λλ€." | |
| fi | |
| - name: μ€ν¨ μ μλ¦Ό | |
| if: failure() | |
| # env: | |
| # DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| # uses: Ilshidur/action-discord@master | |
| # with: | |
| # args: | | |
| # π¨ **λΈλμΉ λκΈ°ν μ€ν¨ μλ¦Ό** | |
| # | |
| # **μ μ₯μ:** ${{ github.repository }} | |
| # **μν¬νλ‘μ°:** ${{ github.workflow }} | |
| # **μ€νμ:** ${{ github.actor }} | |
| # **μ€ν μκ°:** ${{ github.event.schedule }} | |
| # | |
| # **μμΈ μ 보:** | |
| # - μμ URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| # | |
| # λΉ λ₯Έ νμΈμ΄ νμν©λλ€! π | |
| run: | | |
| echo "β λΈλμΉ λκΈ°ν μ€ μ€λ₯κ° λ°μνμ΅λλ€." | |
| exit 1 |