Skip to content

Commit

Permalink
Updated CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Nov 25, 2022
1 parent 4262a13 commit 45af9ee
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 59 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ on:
- master

jobs:
shellcheck:
if: github.event_name == 'push'
name: Shellcheck
uses: ./.github/workflows/shellcheck.yml

todo:
if: github.event_name == 'push'
name: TODO
uses: ./.github/workflows/todo.yml

validate-docs:
runs-on: ubuntu-latest
steps:
Expand Down
28 changes: 5 additions & 23 deletions .github/workflows/docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,8 @@ on:

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
file: ./.devcontainer/Dockerfile
tags: ulisesjeremias/vsl_dev:latest
build-args: |
DEV_IMG=true
uses: ./.github/workflows/docker-publish.yml
with:
tags: ulisesjeremias/vsl:dev
build-args: |
DEV_IMG=true
60 changes: 60 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Docker Publish

concurrency:
group: docker
cancel-in-progress: true

on:
workflow_call:
inputs:
dockerfile:
description: 'The dockerfile to use'
type: string
required: true
default: './Dockerfile'
context:
description: 'The context to use'
type: string
required: true
default: '.'
build-args:
description: 'The build args to use'
type: string
required: false
default: ''
tags:
description: 'The tags to use'
type: string
required: false
default: ''
secrets:
DOCKERHUB_USERNAME:
description: 'The username to use for the image'
required: true
DOCKERHUB_TOKEN:
description: 'The password to use for the image'
required: true

jobs:
docker-publish:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
file: ${{ inputs.dockerfile }}
tags: ${{ inputs.tags }}
build-args: ${{ inputs.build-args }}
42 changes: 9 additions & 33 deletions .github/workflows/docker-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,21 @@ on:

jobs:
docker-latest:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
uses: ./.github/workflows/docker-publish.yml
with:
tags: ulisesjeremias/vsl:latest
build-args: |
DEV_IMG=false
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ulisesjeremias/vsl:latest
docker-tag:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract Git Tag
run: echo "GIT_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v3
- name: Docker Publish
uses: ./.github/workflows/docker-publish.yml
with:
push: true
tags: ulisesjeremias/vsl:${{ env.GIT_TAG }}
build-args: |
DEV_IMG=false
14 changes: 14 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Shellcheck

on:
workflow_call:

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Begin CI...
uses: actions/checkout@v3
- name: Run ShellCheck
uses: ludeeus/[email protected]
4 changes: 1 addition & 3 deletions .github/workflows/todo.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Todo Checker

on:
push:
branches:
- master
workflow_call:

jobs:
todo:
Expand Down

0 comments on commit 45af9ee

Please sign in to comment.