Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
name: CI
name: CD

## this workflow is for deployment to your actual servers which must be configured
## in the runners section

on:
push:
paths-ignore:
- '**.md'
- 'extra/**'
- 'capture/**'
- 'ansible/**'
- 'dashboards/**'
- 'scripts/**'
- '.gitignore'
- 'LICENSE'
branches:
- master
workflow_dispatch:
inputs:
environment:
description: 'Deployment environment'
required: true
default: 'dev'
type: choice
options:
- dev
- production

env:
ghcr_repo_addr: ghcr.io/shayan-ghani/container-exporter:latest

jobs:

deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -32,4 +41,4 @@ jobs:

- name: deploy from ghcr
run: |
IMAGE=${{env.ghcr_repo_addr}} docker compose -f ./container-exporter.yml up -d
IMAGE=${{env.ghcr_repo_addr}} docker compose -f ./container-exporter.yml up -d
34 changes: 1 addition & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
name: CI

on:
push:
paths-ignore:
- '**.md'
- 'extra/**'
- 'capture/**'
- 'ansible/**'
- 'dashboards/**'
- 'scripts/**'
- '.gitignore'
- 'LICENSE'
branches:
- master
pull_request:
paths-ignore:
- 'extra/**'
Expand Down Expand Up @@ -101,24 +89,4 @@ jobs:

# test:

# ## pytest to be implemented here ...

release:
if: github.event_name != 'pull_request' && github.ref_name == 'master'
runs-on: ubuntu-latest
needs: healthcheck
steps:
-
name: Bump version and push tag
id: bump
uses: mathieudutour/github-tag-action@a22cf08638b34d5badda920f9daf6e72c477b07b
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch


- name: Create Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
body: ${{ steps.bump.outputs.changelog }}
tag_name: ${{ steps.bump.outputs.new_tag }}
# ## pytest to be implemented here ...
10 changes: 6 additions & 4 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: CI
name: CI for development branches

on:
push:
branches-ignore:
- 'main'
- 'master'

paths-ignore:
- '**.md'
- 'extra/**'
Expand All @@ -11,9 +15,7 @@ on:
- 'scripts/**'
- '.gitignore'
- 'LICENSE'
branches:
- dev
- ci

pull_request:
paths-ignore:
- 'extra/**'
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Github Releaase

on:
push:
paths-ignore:
- '**.md'
- 'extra/**'
- 'capture/**'
- 'ansible/**'
- 'dashboards/**'
- 'scripts/**'
- '.gitignore'
- 'LICENSE'
branches:
- master

env:
ghcr_repo_addr: ghcr.io/shayan-ghani/container-exporter:latest

jobs:
release:
if: github.event_name != 'pull_request' && github.ref_name == 'master'
runs-on: ubuntu-latest
steps:
-
name: Bump version and push tag
id: bump
uses: mathieudutour/github-tag-action@a22cf08638b34d5badda920f9daf6e72c477b07b
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch


- name: Create Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
body: ${{ steps.bump.outputs.changelog }}
tag_name: ${{ steps.bump.outputs.new_tag }}