Merge pull request #10 from nayla-finance/snyk-upgrade-9b3eb204b673a9… #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI-build | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "v*" | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
IMAGE_TAG: ${{ github.ref_name }}-${{ github.sha }} | |
jobs: | |
build_x86: | |
name: Build and Push Image for x86 | |
runs-on: ubuntu-latest | |
environment: dev | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
labels: | | |
maintainer=${{github.repository_owner}} | |
org.opencontainers.image.title=${{github.repository}} | |
org.opencontainers.image.description=This is ${{github.repository}} build from ${{github.ref_name}} | |
org.opencontainers.image.vendor=${{github.repository_owner}} | |
tags: | | |
type=semver,pattern={{version}} | |
type=ref,event=branch | |
- name: Login to Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set container metadata and create job output | |
run: | | |
echo '${{ steps.meta.outputs.json }}' > job_output.json | |
- name: Upload job output | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build_output | |
path: job_output.json | |
- name: Build and Push the image | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./ | |
file: .docker/Dockerfile-build | |
push: true | |
platforms: linux/amd64 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
# build_arm64: | |
# name: Build and Push Image for arm64 | |
# runs-on: ubuntu-arm64 | |
# environment: dev | |
# permissions: | |
# contents: read | |
# packages: write | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# - name: Set up Docker Buildx | |
# uses: docker/setup-buildx-action@v3 | |
# - name: Docker meta | |
# id: meta | |
# uses: docker/metadata-action@v5 | |
# with: | |
# images: | | |
# ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-arm | |
# labels: | | |
# maintainer=${{github.repository_owner}} | |
# org.opencontainers.image.title=${{github.repository}} | |
# org.opencontainers.image.description=This is ${{github.repository}} build from ${{github.ref_name}} | |
# org.opencontainers.image.vendor=${{github.repository_owner}} | |
# tags: | | |
# type=semver,pattern={{version}} | |
# type=ref,event=branch | |
# - name: Login to Container Registry | |
# uses: docker/login-action@v3 | |
# with: | |
# registry: ${{ env.REGISTRY }} | |
# username: ${{ github.actor }} | |
# password: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Build and Push the image | |
# id: docker_build | |
# uses: docker/build-push-action@v6 | |
# with: | |
# context: ./ | |
# file: .docker/Dockerfile-build | |
# push: true | |
# platforms: linux/arm64 | |
# tags: ${{ steps.meta.outputs.tags }} | |
# labels: ${{ steps.meta.outputs.labels }} |