Skip to content

Commit 7b28221

Browse files
committed
upadted the git action to run on manual dispatch
1 parent b484cf4 commit 7b28221

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

.github/workflows/build-deploy.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ name: Build & Deploy
22
run-name: Initiated by ${{ github.actor }}
33
# Run on main branch with tag v*.*.*
44
on:
5-
push:
6-
branches:
7-
- main
8-
tags:
9-
- v*.*.*
5+
workflow_dispatch:
6+
inputs:
7+
tag:
8+
description: 'Tag to deploy'
9+
required: true
10+
default: 'v0.0.0'
1011
jobs:
1112
build:
1213
runs-on: ubuntu-latest
13-
outputs:
14-
tag: ${{ steps.get_tag.outputs.tag }}
1514
steps:
1615
- uses: actions/checkout@v2
1716
- uses: actions/setup-node@v2
@@ -28,17 +27,14 @@ jobs:
2827
COMMIT_APP_BASE_URL : https://app.commit.dev
2928
COMMIT_AUTH0_DOMAIN : https://commitdev.auth0.com
3029
COMMIT_CLIENT_ID : ${{ secrets.COMMIT_CLIENT_ID_STAGING }}
31-
# Get most recent tag
32-
- name: Get most recent tag
33-
id: get_tag
34-
run: echo name=tag::$(git describe --tags `git rev-list --tags --max-count=1`) >> $GITHUB_OUTPUT
30+
3531
# Rename the VSIX file to the version number
3632
- name: Rename VSIX file
37-
run: mv *.vsix commit-extension-${{ steps.get_tag.outputs.tag }}.vsix
33+
run: mv *.vsix commit-extension-${{ github.event.inputs.tag }}.vsix
3834
# Upload the VSIX file as an artifact with version number
3935
- uses: actions/upload-artifact@v3
4036
with:
41-
name: commit-extension-${{ steps.get_tag.outputs.tag }}
37+
name: commit-extension-${{ github.event.inputs.tag }}
4238
path: ./*.vsix
4339

4440
# Create a release with the version number
@@ -49,15 +45,15 @@ jobs:
4945
# Download the VSIX file from the artifact
5046
- uses: actions/download-artifact@v2
5147
with:
52-
name: commit-extension-${{ needs.build.outputs.tag }}
48+
name: commit-extension-${{ github.event.inputs.tag }}
5349
path: ./
5450

5551
# Check if the release already exists
5652
- name: Check if release exists
5753
id: check_release
5854
uses: softprops/action-gh-release@v1
5955
with:
60-
tag_name: ${{ needs.build.outputs.tag }}
56+
tag_name: ${{ github.event.inputs.tag }}
6157
env:
6258
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6359

0 commit comments

Comments
 (0)