Update actions/checkout action to v4 #466
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
# This is a basic workflow to help you get started with Actions | |
name: Build | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
image_job: | |
name: Create Docker Image | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
dockerfile: | |
- 'Dockerfile' | |
- name: Docker Login | |
if: steps.changes.outputs.dockerfile == 'true' | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Docker Build | |
if: steps.changes.outputs.dockerfile == 'true' | |
run: | | |
docker build . -t disroop/vscode-plugin-builder:latest | |
- name: Publish | |
if: steps.changes.outputs.dockerfile == 'true' | |
run: | | |
docker push disroop/vscode-plugin-builder:latest | |
vscode_build_job: | |
name: VSCode Build Plugin | |
needs: [image_job] | |
if: always() | |
runs-on: ubuntu-latest | |
container: | |
image: disroop/vscode-plugin-builder:latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: install dependencies | |
run: npm install | |
- name: lint | |
run: npm run lint | |
- name: compile | |
run: npm run compile | |
- name: run unit test | |
run: npm run test | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: create vscode package | |
run: vsce package | |
- name: Upload a Build Artifact | |
if: contains('refs/heads/master', github.ref) | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ./*.vsix | |