From c5baf34b7e105899d4281b6eb75145ec7aedb1fc Mon Sep 17 00:00:00 2001 From: Keanu Date: Tue, 29 Dec 2020 13:01:02 +0000 Subject: [PATCH 1/2] Attempt to merge two workflows. --- .github/workflows/codeql-analysis.yml | 41 --------------------------- .github/workflows/image.yml | 29 +++++++++++++++++++ 2 files changed, 29 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 200682a..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [typescript] - pull_request: - branches: [typescript] - schedule: - - cron: "0 5 * * 1" - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 2 - - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - - name: Setup Node.JS - uses: actions/setup-node@v2-beta - with: - node-version: "12" - - run: npm ci - - - name: Build codebase - run: npm run build - - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - config-file: ./.github/codeql/codeql-config.yml - languages: javascript - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index dac2e7a..efd172f 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -6,7 +6,36 @@ on: - docker jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: Setup Node.JS + uses: actions/setup-node@v2-beta + with: + node-version: "12" + - run: npm ci + + - name: Build codebase + run: npm run build + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + config-file: ./.github/codeql/codeql-config.yml + languages: javascript + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 + build: + needs: analyze runs-on: ubuntu-latest steps: - name: Checkout code From aeff8ac832e829ae3096e5a65f3af7bc23fefd1c Mon Sep 17 00:00:00 2001 From: Keanu Date: Tue, 29 Dec 2020 13:12:03 +0000 Subject: [PATCH 2/2] Minor changes. --- .github/workflows/image.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index efd172f..c575066 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -1,4 +1,4 @@ -name: Build Docker Image + Push +name: CodeQL + Docker Image on: push: branches: @@ -7,9 +7,8 @@ on: jobs: analyze: - name: Analyze + name: CodeQL Analysis runs-on: ubuntu-latest - steps: - name: Checkout repository uses: actions/checkout@v2 @@ -35,18 +34,24 @@ jobs: uses: github/codeql-action/analyze@v1 build: + name: Build Docker Image needs: analyze runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout repository uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Install Docker BuildX id: buildx uses: crazy-max/ghaction-docker-buildx@v1 with: buildx-version: latest + - name: Login to Docker Hub run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + - name: Build the image run: | docker buildx build \