Skip to content

add github actions build #22

add github actions build

add github actions build #22

Workflow file for this run

name: Docker Image Build
on:
- pull_request
env:
REGISTRY: quay.io
ORG: opentelekomcloud
PROJECT: circle-partner-navigator-frontend
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
opentelekomcloud/circle-partner-navigator-frontend
"${{env.REGISTRY}}/${{env.ORG}}/${{env.PROJECT}}"
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
# - name: Buildah Action
# id: build-image
# uses: redhat-actions/buildah-build@v2
# with:
# containerfiles: ./Dockerfile
# image: "${{env.REGISTRY}}/${{env.ORG}}/${{env.PROJECT}}"
# tags: ${{ github.sha }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
opentelekomcloud/circle-partner-navigator-frontend
"${{env.REGISTRY}}/${{env.ORG}}/${{env.PROJECT}}"
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Buildah Action
id: build-image
uses: redhat-actions/buildah-build@v2
with:
containerfiles: ./Dockerfile
tags: ${{ steps.meta.outputs.tags }}
- name: Login
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: ${{ env.REGISTRY }}
- name: Push
id: push-to-artifactory
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ github.repository_id }}-${{ github.job }} latest
registry:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}