Skip to content

Deploy

Deploy #1

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name for the release'
required: true
type: string
workflow_call:
inputs:
tag_name:
description: 'Tag name for the release'
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag_name }}
fetch-depth: 1
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm install
- name: Build VSIX
run: npm run package
- name: Upload VSIX to Release
uses: softprops/action-gh-release@v2
with:
files: "*.vsix"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check if VSCE_PAT exists
id: check_secret
run: |
if [ -n "${{ secrets.VSCE_PAT }}" ]; then
echo "has_secret=true" >> $GITHUB_OUTPUT
else
echo "has_secret=false" >> $GITHUB_OUTPUT
fi
- name: Publish to VS Code Marketplace
if: success() && steps.check_secret.outputs.has_secret == 'true'
run: npm run deploy
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}