Skip to content

chore: updated openapi #120

chore: updated openapi

chore: updated openapi #120

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
tags:
- "*.*.*"
pull_request:
branches:
- main
types:
- labeled
env:
REGISTRY_IMAGE: ${{ secrets.DOCKER_USERNAME }}/api-gateway
GHCR_IMAGE: fis2425/api-gateway
PR_ID: ${{ github.event.pull_request.number }}
TAG: ${{ github.ref_name }}
jobs:
build:
runs-on: ubuntu-latest
if: (github.event.pull_request && github.event.label.name == '🐳 Dockerize') || github.event_name == 'push'
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout ⬇️
uses: actions/checkout@v4.2.2
with:
show-progress: false
- name: Copy Config File 📄
run: cp config.yaml.example config.yaml
- name: Configure Docker Buildx ⚙️
uses: docker/setup-buildx-action@v3.8.0
- name: Login to DockerHub 🔑
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry 🔑
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6.10.0
with:
context: .
file: Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ startsWith(github.ref, 'refs/tags/') && format('{0}:{1}', env.REGISTRY_IMAGE, env.TAG) || '' }}
${{ github.ref == 'refs/heads/main' && format('{0}:latest', env.REGISTRY_IMAGE) || '' }}
${{ github.event_name == 'pull_request' && format('{0}:PR.{1}', env.REGISTRY_IMAGE, env.PR_ID) || '' }}
- name: Build and Push Ghcr Image
uses: docker/build-push-action@v6.10.0
with:
context: .
file: Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ startsWith(github.ref, 'refs/tags/') && format('ghcr.io/{0}:{1}', env.GHCR_IMAGE, env.TAG) || '' }}
${{ github.ref == 'refs/heads/main' && format('ghcr.io/{0}:latest', env.GHCR_IMAGE) || '' }}
${{ github.event_name == 'pull_request' && format('ghcr.io/{0}:PR.{1}', env.GHCR_IMAGE, env.PR_ID) || '' }}