Skip to content

Commit

Permalink
Merge pull request #30 from niminim998/feature-ci-mod
Browse files Browse the repository at this point in the history
  • Loading branch information
yonch authored Dec 31, 2024
2 parents d7d35a0 + a3f8f46 commit c75f586
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ on:
workflow_dispatch:
push:
branches:
- feature-mem-collector-ci
- main
paths:
- 'cmd/**'
- 'cmd/collector/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# - name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ vars.DOCKERHUB_USERNAME }} # Need to be set as Github variable in the repository.
# password: ${{ secrets.DOCKERHUB_TOKEN }} # Need to be set as Github secret in the repository.
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
Expand All @@ -29,21 +30,20 @@ jobs:
id: docker-metadata
uses: docker/metadata-action@v5
with:
images: ${{ inputs.container-repo }}
images: ghcr.io/${{ github.repository }}/collector
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=raw,value={{branch}}-{{sha}}
- name: Build and push
uses: docker/build-push-action@v6
with:
# push: ${{ github.event_name != 'pull_request' }}
push: false
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker-metadata.outputs.tags }}
labels: ${{ steps.docker-metadata.outputs.labels }}
context: cmd/collector
file: cmd/collector/Dockerfile
platforms: linux/amd64,linux/arm64
# cache-from: type=registry,ref=<Placeholder>:cache # Need to add the repository name
# cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=<Placeholder>:cache,mode=max # Need to add the repository name
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/collector:cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=ghcr.io/${{ github.repository }}/collector:cache,mode=max

24 changes: 12 additions & 12 deletions .github/workflows/ci-cpi-count.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ on:
workflow_dispatch:
push:
branches:
- feature-mem-collector-ci
- main
paths:
- 'cmd/**'
- 'cmd/cpi-count/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# - name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ vars.DOCKERHUB_USERNAME }} # Need to be set as Github variable in the repository.
# password: ${{ secrets.DOCKERHUB_TOKEN }} # Need to be set as Github secret in the repository.
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
Expand All @@ -29,23 +30,22 @@ jobs:
id: docker-metadata
uses: docker/metadata-action@v5
with:
images: ${{ inputs.container-repo }}
images: ghcr.io/${{ github.repository }}/cpi-count
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=raw,value={{branch}}-{{sha}}
- name: Build and push
uses: docker/build-push-action@v6
with:
# push: ${{ github.event_name != 'pull_request' }}
push: false
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker-metadata.outputs.tags }}
labels: ${{ steps.docker-metadata.outputs.labels }}
context: cmd/cpi-count
file: cmd/cpi-count/Dockerfile
platforms: linux/amd64,linux/arm64
# cache-from: type=registry,ref=<Placeholder>:cache # Need to add the repository name
# cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=<Placeholder>:cache,mode=max # Need to add the repository name
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/cpi-count:cache # Need to add the repository name
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=ghcr.io/${{ github.repository }}/cpi-count:cache,mode=max # Need to add the repository name



0 comments on commit c75f586

Please sign in to comment.