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
17 changes: 2 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@ on:
- '.gitignore'
- 'LICENSE'

permissions:
contents: write
pull-requests: read

env:
ghcr_repo_addr: ghcr.io/shayan-ghani/container-exporter:latest
docker_repo_addr: shayanghani/container-exporter:latest
docker_hub_user: shayanghani
ghcr_repo_addr: ghcr.io/shayan-ghani/container-exporter:pr-${{github.run_id}}

jobs:

Expand All @@ -28,12 +23,6 @@ jobs:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.docker_hub_user }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v3
with:
Expand All @@ -52,9 +41,7 @@ jobs:
with:
context: .
push: true
tags: |
${{env.ghcr_repo_addr}}
${{env.docker_repo_addr}}
tags: ${{env.ghcr_repo_addr}}



Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI for development branches
name: CI-development

on:
push:
Expand Down Expand Up @@ -26,15 +26,12 @@ on:
- '.gitignore'
- 'LICENSE'

permissions:
contents: write
pull-requests: read

env:
ghcr_repo_addr: ghcr.io/shayan-ghani/container-exporter:latest
ghcr_repo_addr: ghcr.io/shayan-ghani/container-exporter:${{github.action}}-${{github.run_id}}

jobs:
probe:
build-and-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
42 changes: 40 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,20 @@ on:
branches:
- master

permissions:
contents: write
pull-requests: read

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

docker_repo_addr: shayanghani/container-exporter
docker_hub_user: shayanghani

jobs:
release:
outputs:
image_tag: ${{ steps.bump.outputs.new_tag }}

if: github.event_name != 'pull_request' && github.ref_name == 'master'
runs-on: ubuntu-latest
steps:
Expand All @@ -35,4 +44,33 @@ jobs:
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
body: ${{ steps.bump.outputs.changelog }}
tag_name: ${{ steps.bump.outputs.new_tag }}
tag_name: ${{ steps.bump.outputs.new_tag }}

docker-push:
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.docker_hub_user }}
password: ${{ secrets.DOCKER_TOKEN }}

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

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

- name: Build and Push to Dockerhub
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
"${{env.docker_repo_addr}}:${{ needs.release.outputs.image_tag }}"
"${{env.docker_repo_addr}}:latest"