Skip to content

Refactor: GitHub Actions과정을 최적화한다 #1

Refactor: GitHub Actions과정을 최적화한다

Refactor: GitHub Actions과정을 최적화한다 #1

Workflow file for this run

name: CICD Extension
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
permissions:
contents: write
jobs:
build-extension:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: pnpm
- name: pnpm install
run: pnpm install --frozen-lockfile --prefer-offline
- name: setting environment variables
run: |
echo "${{ secrets.SHARED_ENV_FILE }}" >> packages/shared/.env
echo WEB_URL=${{ secrets.PROD_WEB_URL }} >> packages/shared/.env
- name: build
run: pnpm run build:extension
- name: Zip the build files
run: pnpm run zip
- name: Upload Extension
uses: actions/upload-artifact@v4
with:
name: extension
path: dist-zip/extension.zip
upload-extension:
needs: build-extension
runs-on: ubuntu-22.04
if: ${{ startsWith(github.ref, 'refs/tags/v')}}
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Upload zipped file on chrome store
uses: mnao305/[email protected]
with:
file-path: extension/extension.zip
extension-id: eaiojpmgklfngpjddhoalgcpkepgkclh
client-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
refresh-token: ${{ secrets.REFRESH_TOKEN }}
publish: false
- name: Update gitHub releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes