diff --git a/.github/workflows/ci.yaml b/.github/workflows/deploy.yaml similarity index 64% rename from .github/workflows/ci.yaml rename to .github/workflows/deploy.yaml index 98173a6..c565aa8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/deploy.yaml @@ -1,30 +1,20 @@ -name: CI +name: Deploy on: - push: + workflow_run: + workflows: [Test] + types: [completed] branches: [master] jobs: - test: - name: Run tests - runs-on: ubuntu-latest - environment: Production - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - run: npm install - - run: npm run test - - publish: + publish-extension: name: Publish to marketplace runs-on: ubuntu-latest environment: Production - needs: test + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 16 - run: npm install diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..6f6a957 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,19 @@ +name: Test + +on: + push: + branches: [master] + pull_request: + types: [opened, synchronize, reopened] + +jobs: + run-tests: + name: Run tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 16 + - run: npm install + - run: npm run test