From 2082667b2a4fcb633e8835436efa5f83e8e471ad Mon Sep 17 00:00:00 2001 From: Twinki Date: Sat, 27 Jan 2024 12:27:11 -0500 Subject: [PATCH 1/2] Cleanup workflows --- .github/workflows/docker-hub.yml | 28 ++++++++----------- .github/workflows/linting.yml | 48 ++++++++++++++++++++------------ .github/workflows/release.yml | 19 +++++++------ 3 files changed, 52 insertions(+), 43 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 9e0ceaa23..087d5686d 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -1,36 +1,32 @@ -name: Docker-Image-Dev -on: +name: Developer image +on: push: - branches: [ main ] + branches: [main] jobs: push: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Login to DockerHub + - name: Docker - Login uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Docker meta + - name: Docker - Metadata id: meta uses: docker/metadata-action@v5 with: - # list of Docker images to use as base name for tags - images: | - ${{ github.repository }} - # generate Docker tags based on the following events/attributes - tags: | - type=raw,value=dev - # always generate latest tag on push + images: ${{ github.repository }} + tags: type=raw,value=dev + flavor: latest=false - - name: Build and push to DockerHub - id: docker_build + - name: Docker - Build / Push uses: docker/build-push-action@v5 with: push: true tags: | - ${{ steps.meta.outputs.tags }} \ No newline at end of file + ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 0972a7c88..efc315670 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,36 +1,48 @@ name: Linting -on: [pull_request] +on: + pull_request: +run-name: Pull request - ${{ github.event.pull_request.number }} jobs: shellcheck: + name: Lint - Shell runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@master + - name: Checkout + uses: actions/checkout@v4 + + - name: Shellcheck + uses: ludeeus/action-shellcheck@2.0.0 + dockerlint: + name: Lint - Docker runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - uses: hadolint/hadolint-action@v2.0.0 + - name: Checkout + uses: actions/checkout@v4 + + - uses: hadolint/hadolint-action@v3.1.0 with: dockerfile: Dockerfile - lint: 'hadolint' + markdownlint: + name: Lint - Markdown runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v2 - - uses: DavidAnson/markdownlint-cli2-action@v15 - with: - config: '.markdownlint.jsonc' - globs: '**/*.md' + - name: Checkout + uses: actions/checkout@v4 + + - name: Lint - Markdown + uses: DavidAnson/markdownlint-cli2-action@v15 + with: + config: ".markdownlint.jsonc" + globs: "**/*.md" + test-build: + name: Docker - Build runs-on: ubuntu-latest steps: - - name: Build the Image - uses: docker/build-push-action@v2 + - name: Docker - Build + uses: docker/build-push-action@v5 with: - push: false \ No newline at end of file + push: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8b91be97..b94b3f9dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ name: Release -on: +on: release: types: [published] @@ -7,15 +7,16 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Login to DockerHub - uses: docker/login-action@v3 + - name: Docker - Login + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Docker meta + - name: Docker - Metadata id: meta uses: docker/metadata-action@v5 with: @@ -28,11 +29,11 @@ jobs: type=semver,pattern=v{{major}}.{{minor}} type=semver,pattern=v{{major}} # always generate latest tag on push - flavor: | - latest=true - - name: Build and push to DockerHub & GitHub Packages + flavor: latest=true + + - name: Docker - Build / Push id: docker_build uses: docker/build-push-action@v5 with: push: true - tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }} From 46470c49e804472571fd4a18d5c41bf968f37ca4 Mon Sep 17 00:00:00 2001 From: Twinki Date: Sat, 27 Jan 2024 12:34:34 -0500 Subject: [PATCH 2/2] Tweaks --- .github/workflows/docker-hub.yml | 3 +-- .github/workflows/release.yml | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 087d5686d..d272619e2 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -28,5 +28,4 @@ jobs: uses: docker/build-push-action@v5 with: push: true - tags: | - ${{ steps.meta.outputs.tags }} + tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b94b3f9dd..df8c48f72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,15 +20,12 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - # list of Docker images to use as base name for tags - images: | - ${{ github.repository }} + images: ${{ github.repository }} # generate Docker tags based on the following events/attributes tags: | type=semver,pattern=v{{version}} type=semver,pattern=v{{major}}.{{minor}} type=semver,pattern=v{{major}} - # always generate latest tag on push flavor: latest=true - name: Docker - Build / Push