Skip to content

feat(ddos-continuous-deployment.yml): added package generation #1

feat(ddos-continuous-deployment.yml): added package generation

feat(ddos-continuous-deployment.yml): added package generation #1

name: Build, Push and Deploy Docker Image
on:
push:
branches:
- master
paths-ignore:
- README.md
jobs:
continuous-deployment:
name: Build, Push and Deploy Docker Image
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/whatsupdoc
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern=v{{major}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Publish image
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# - name: Setup kubectl
# uses: azure/setup-kubectl@v4.0.0
# - name: Set kubectl context with Service Account
# uses: azure/k8s-set-context@v4.0.0
# with:
# method: service-account
# k8s-url: ${{ secrets.K8S_URL }}
# k8s-secret: ${{ secrets.K8S_SECRET }}
# - name: Rollout restart deployment
# run: kubectl -n whatsupdoc get deployments --no-headers -l app.kubernetes.io/component=backend | awk '{ print $1; }' | xargs kubectl -n whatsupdoc rollout restart deployment
# - name: Rollout status deployment
# run: kubectl -n whatsupdoc get deployments --no-headers -l app.kubernetes.io/component=backend | awk '{ print $1; }' | xargs kubectl -n whatsupdoc rollout status deployment