Skip to content

Commit

Permalink
fix(ci/cd): add support to auto-tagging both for git and docker
Browse files Browse the repository at this point in the history
  • Loading branch information
WarriorsSami committed Jun 15, 2024
1 parent 0408e33 commit a009946
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 35 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/anubis-eval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Anubis - Build Docker image and publish to GitHub Packages

on:
push:
branches:
- develop
tags:
- "v*.*.*"

# branches:
# - develop

paths:
- "anubis-eval/**"
Expand Down Expand Up @@ -34,20 +37,22 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@v5
with:
context: anubis-eval
push: true
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/dapr-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Dapr - Build Docker image and publish to GitHub Packages

on:
push:
branches:
- develop
tags:
- "v*.*.*"

# branches:
# - develop

paths:
- "dapr/**"
Expand Down Expand Up @@ -34,20 +37,22 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@v5
with:
context: dapr
push: true
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/enki-problems.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Enki - Build Docker image and publish to GitHub Packages

on:
push:
branches:
- develop
tags:
- "v*.*.*"

# branches:
# - develop

paths:
- "enki-problems/**"
Expand Down Expand Up @@ -34,20 +37,22 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@v5
with:
context: enki-problems
push: true
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/eval-lb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Eval Nginx Load Balancer - Build Docker image and publish to GitHub Packag

on:
push:
branches:
- develop
tags:
- "v*.*.*"

# branches:
# - develop

paths:
- "anubis-eval/eval-lb/**"
Expand Down Expand Up @@ -34,20 +37,22 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@v5
with:
context: anubis-eval/eval-lb
push: true
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/hermes-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Hermes - Build Docker image and publish to GitHub Packages

on:
push:
branches:
- develop
tags:
- "v*.*.*"

# branches:
# - develop

paths:
- "hermes-tests/**"
Expand Down Expand Up @@ -34,20 +37,22 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@v5
with:
context: hermes-tests
push: true
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/odin-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Odin - Build Docker image and publish to GitHub Packages

on:
push:
branches:
- develop
tags:
- "v*.*.*"

# branches:
# - develop

paths:
- "odin-gateway/**"
Expand Down Expand Up @@ -34,20 +37,22 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@v5
with:
context: odin-gateway
push: true
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/quetzalcoatl-auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Quetzalcoatl - Build Docker image and publish to GitHub Packages

on:
push:
branches:
- develop
tags:
- "v*.*.*"

# branches:
# - develop

paths:
- "quetzalcoatl-auth/**"
Expand Down Expand Up @@ -34,20 +37,22 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@v5
with:
context: quetzalcoatl-auth
push: true
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
push:
branches:
- develop

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.PAT }}
release-type: simple

0 comments on commit a009946

Please sign in to comment.