Giter Club home page Giter Club logo

github_package's Introduction

github_package

목적

GitHub Actions를 통한 배포 시스템을 진행 시에 repository간 공통 코드를 관리하고자 만들었습니다.

해당 Package 사용 방법

$ repository name > .npmrc

@{github_id}:registry=https://npm.pkg.github.com/

기능

  • action.yml에 정의된 변수 값에 따라 기능이 실행됩니다.
name: "Slack message"
description: "Send job results on Slack via Incoming Webhooks 🔔"
inputs:
  ACTION_NAME:
    description: "Name of the action for a more descriptive message"
    required: true # 필수 옵션
  JOB:
    description: "JSON-stringified `job` variable. Must be passed to output the actual status of the job"
    required: true # 필수 옵션
  SLACK_WEBHOOK_URL:
    description: "URL of the Incoming Webhook provided by Slack"
    required: true # 필수 옵션
runs:
  using: 'node12'                                           // 설치 os
  main: 'index.js'                                           // Github Actions에 사용시 실행될 파일 명

Github Actions에서는 아래와 같이 패키지 설치 후에 진행하면 됩니다.

 name: Example Github Actions Workflow

on:
  push:
    branches:
      - master

jobs:
  merge:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [10.x]

    steps:
      - uses: actions/checkout@v1
        with:
          ref: ${{ matrix.refs }}

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Package Install & Yarn Build Backdoor
        run: |
          yarn
          ls -al
        env:
          NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}

      - name: Send Slack
        if: success() || failure()
        uses: ./node_modules/@seye2/github_package
        with:
          ACTION_NAME: Run test scripts
          JOB: ${{ toJson(job) }}
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required

github_package's People

Contributors

seye2 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.