CDS Tag Publish #7
Workflow file for this run
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: CDS Tag Publish | |
on: | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- uses: actions/cache@v3 | |
id: pnpm-cache | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm- | |
- if: steps.pnpm-cache.outputs.cache-hit != 'true' | |
run: pnpm install --no-frozen-lockfile | |
- run: pnpm run build | |
- name: Get SLUG and SHA | |
id: tag-meta | |
run: | | |
BRANCH_SLUG=$(echo "${GITHUB_REF#refs/heads/}" | sed 's/\//-/g') | |
SHORT_SHA=$(echo "${GITHUB_SHA::6}") | |
echo "BRANCH_SLUG=${BRANCH_SLUG}" >> $GITHUB_OUTPUT | |
echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_OUTPUT | |
- name: Publish Dev Tag | |
run: | | |
rm -rf src .husky .github .storybook .prettierrc .eslint.config.js pnpm-lock.yaml vercel.json vite.config.js | |
git config user.email "[email protected]"" | |
git config user.name "lebmouse" | |
git add . | |
git commit -m "chore: release ${BRANCH_SLUG}-${SHORT_SHA}" | |
git tag -a '${BRANCH_SLUG}${SHORT_SHA}' -m 'Release ${BRANCH_SLUG}-${SHORT_SHA}' | |
git push origin '${BRANCH_SLUG}${SHORT_SHA}' | |