Coder Social home page Coder Social logo

github-artifacts-action's Introduction

Assets Artifacts Action

A GitHub Action to upload artifacts to a release

JS Quality Assurance

Assets Artifacts, is designed to compile the assets of your project and commit and push these assets back into the repository. It also moves the tags to point to the commit where the assets are pushed.

What it does

  1. Compiles the assets: The action runs the yarn build command to compile the assets of your project.

  2. Commits and pushes the assets: After the compilation is completed, the action commits the changes and pushes the assets back into the repository.

  3. Moves the tags: The action moves the tags to point to the commit where the assets are pushed.

Configuration

  • command Pass the command the action has to use to build the artifacts. Default to yarn build.
  • target-dir Pass the director where the action has to store the artifacts. Default to build.

Workflow Example

Here is an example of how to use this action in a workflow:

name: Build Artifacts

on:
  push:
    tags:
      - '*'

jobs:
  build:
    runs-on: ubuntu-latest
    if: ${{ !contains(github.event.head_commit.message, '--skip-assets-artifacts') }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Node
        uses: actions/setup-node@v2
        with:
          cache: 'yarn'
          node-version: '20'

      - name: Install Dependencies
        run: yarn install

      - name: Build Artifacts
        uses: widoz/github-artifacts-action@v1
        env:
          GIT_USER: ${{ secrets.GIT_USER }}
          GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
          HUSKY: 0
        with:
          command: 'npm run build'
          target-dir: './dist'

In this workflow, the action is triggered on every push event that includes a tag. The workflow runs on the latest version of Ubuntu and will not run if the commit message contains --skip-assets-artifacts.

The workflow includes steps to check out the repository, setup Node.js with a specified version and cache configuration, install dependencies using yarn install, and finally, build the artifacts using the widoz/github-artifacts-action@v1 action.

The GIT_USER and GIT_EMAIL environment variables are used for the commit and should be stored as secrets in your GitHub repository. The HUSKY environment variable is set to 0 to disable Husky during the action run.

github-artifacts-action's People

Contributors

dependabot[bot] avatar widoz avatar

Watchers

 avatar  avatar

github-artifacts-action's Issues

Using GitHub CLI

Hello!
GitHub CLI is included in every GHA image.
Artifacts could be zipped then uploaded as release assets.
gh release upload ${{ github.ref_name }} asset.zip

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.