From 8ece4b641229d16fd7d453e3f7cca40e8dde4373 Mon Sep 17 00:00:00 2001 From: Jef LeCompte Date: Sun, 17 Jan 2021 15:59:32 -0500 Subject: [PATCH] ci: update names and steps (#1720) --- .github/workflows/ci.yaml | 23 +++++++++++-------- .github/workflows/documentation.yaml | 11 +++++---- .../{nightly.yaml => nightly-release.yaml} | 14 ++++++----- .../{pr-lint.yaml => pull-request-lint.yaml} | 8 ++++--- .github/workflows/{cd.yaml => release.yaml} | 15 +++++++----- .github/workflows/stale.yaml | 4 ++-- 6 files changed, 44 insertions(+), 31 deletions(-) rename .github/workflows/{nightly.yaml => nightly-release.yaml} (60%) rename .github/workflows/{pr-lint.yaml => pull-request-lint.yaml} (56%) rename .github/workflows/{cd.yaml => release.yaml} (68%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index aa9b9e3..ae940e7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,23 +1,25 @@ -name: ci +name: Continuous Integration on: pull_request: branches: - main jobs: build-lint: + name: Build and lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2.1.4 + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2.1.4 with: node-version: 14.15.4 - - uses: actions/cache@v2 + - name: Setup build cache + uses: actions/cache@v2 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: ${{ runner.os }}-node- - - name: Add problem matcher - run: echo "::add-matcher::.github/xo-problem-matcher.json" - name: Install dependencies run: npm ci - name: Compile TypeScript @@ -25,16 +27,19 @@ jobs: - name: Run linter run: npm run lint build-docker: + name: Build Docker image runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: dorny/paths-filter@v2.7.0 + - name: Checkout repository + uses: actions/checkout@v2 + - name: Run paths filter + uses: dorny/paths-filter@v2.7.0 id: filter with: filters: | build: - 'Dockerfile' - 'package*.json' - - name: Build image + - name: Build Docker image if: steps.filter.outputs.build == 'true' run: docker build . diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index f13d275..8e7bead 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -1,19 +1,20 @@ -name: documentation +name: Documentation on: push: branches: - main jobs: - deploy: + build-deploy: + name: Build and publish documentation runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - - name: Setup Python runtime + - name: Setup Python uses: actions/setup-python@v2 with: python-version: 3.x - - name: Install Python dependencies + - name: Install Python packages run: pip install mkdocs-material mkdocs-git-revision-date-plugin mkdocs-macros-plugin - - name: Deploy documentation + - name: Build and publish documentation run: mkdocs gh-deploy --force diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly-release.yaml similarity index 60% rename from .github/workflows/nightly.yaml rename to .github/workflows/nightly-release.yaml index 010bd17..a5c511e 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly-release.yaml @@ -1,19 +1,21 @@ -name: nightly +name: Nightly Release on: schedule: - cron: '0 0 * * *' workflow_dispatch: {} jobs: - publish: + build-publish: + name: Build and publish nightly Docker image runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: login into github package registry + - name: Checkout repository + uses: actions/checkout@v2 + - name: Login into GitHub Container Registry run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin - - name: build nightly docker image + - name: Build Docker image run: | docker build \ -t "ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_SHA:0:7}" \ -t "ghcr.io/${GITHUB_REPOSITORY}:nightly" . - - name: publish nightly image + - name: Publish Docker image run: docker push "ghcr.io/${GITHUB_REPOSITORY}" diff --git a/.github/workflows/pr-lint.yaml b/.github/workflows/pull-request-lint.yaml similarity index 56% rename from .github/workflows/pr-lint.yaml rename to .github/workflows/pull-request-lint.yaml index 9b85c77..c731454 100644 --- a/.github/workflows/pr-lint.yaml +++ b/.github/workflows/pull-request-lint.yaml @@ -1,4 +1,4 @@ -name: pr-lint +name: Pull Request Lint on: pull_request_target: types: @@ -7,9 +7,11 @@ on: - reopened - synchronize jobs: - main: + pull-request-lint: + name: Lint pull request runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v3.1.0 + - name: Lint pull request + uses: amannn/action-semantic-pull-request@v3.1.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cd.yaml b/.github/workflows/release.yaml similarity index 68% rename from .github/workflows/cd.yaml rename to .github/workflows/release.yaml index 6325ac9..1001a27 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/release.yaml @@ -1,4 +1,4 @@ -name: cd +name: Release on: push: branches: @@ -7,17 +7,20 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: google-github-actions/release-please-action@v2.15 + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup release please + uses: google-github-actions/release-please-action@v2.15 id: release with: token: ${{ secrets.GITHUB_TOKEN }} release-type: simple changelog-path: docs/changelog.md package-name: streetmerchant - - name: login into github package registry + - name: Login into GitHub Container Registry + if: ${{ steps.release.outputs.release_created }} run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin - - name: build latest docker image + - name: Build Docker image if: ${{ steps.release.outputs.release_created }} run: | docker build \ @@ -25,6 +28,6 @@ jobs: -t "ghcr.io/${GITHUB_REPOSITORY}:latest" . env: TAG_NAME: ${{ steps.release.outputs.tag_name }} - - name: publish latest image + - name: Publish Docker image if: ${{ steps.release.outputs.release_created }} run: docker push "ghcr.io/${GITHUB_REPOSITORY}" diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index edd578a..41f8e8f 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -1,4 +1,4 @@ -name: 'Close stale issues' +name: Stale Checker on: schedule: - cron: '0 0 * * *' @@ -21,6 +21,6 @@ jobs: stale-pr-message: ${{ env.STALE_MESSAGE }} env: CLOSE_MESSAGE: 'This issue has been closed because it is stale. Reopen if necessary.' - EXEMPT_LABEL: 'status: needs discussion' + EXEMPT_LABEL: 'status: needs discussion,priority: low,priority: medium, priority: high,status: help wanted,status: in progress' STALE_LABEL: 'status: stale' STALE_MESSAGE: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'