Skip to content

update footer + and link to newest #69

update footer + and link to newest

update footer + and link to newest #69

name: Build Services on Directory change
on:
push:
paths:
- "client/**"
- "services/**"
branches:
- master
workflow_dispatch:
inputs:
all:
description: "Build all services"
required: true
default: true
type: boolean
env:
REGISTRY: ghcr.io
CLIENT_IMAGE_NAME: ${{ github.repository }}/client
GATEWAY_IMAGE_NAME: ${{ github.repository }}/gateway
MEME_SERVICE_IMAGE_NAME: ${{ github.repository }}/service
jobs:
filter:
runs-on: ubuntu-latest
outputs:
client_changed: ${{ steps.filter.outputs.client }}
backend_changed: ${{ steps.filter.outputs.backend }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
client:
- 'client/**'
backend:
- 'services/**'
build-client:
permissions:
contents: read
packages: write
attestations: write
id-token: write
needs: filter
if: needs.filter.outputs.client_changed == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: create env.production
run: |
cd client
echo "NEXT_PUBLIC_API_HOST=${{ secrets.NEXT_PUBLIC_API_HOST }}" > .env.production
echo "NEXT_PUBLIC_GOOGLE_ANALYTICS_TAG=${{ secrets.NEXT_PUBLIC_GOOGLE_ANALYTICS_TAG }}" >> .env.production
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.CLIENT_IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value=qasrelmemez/client
- name: Build and push client image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: client
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.CLIENT_IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
build-backend:
permissions:
contents: read
packages: write
attestations: write
id-token: write
needs: filter
if: needs.filter.outputs.backend_changed == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.GATEWAY_IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value=qasrelmemez/gateway
- name: Build and push gateway image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: services
file: services/gateway.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.GATEWAY_IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
build-meme-service:
permissions:
contents: read
packages: write
attestations: write
id-token: write
needs: filter
if: needs.filter.outputs.backend_changed == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.MEME_SERVICE_IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value=qasrelmemez/meme-service
- name: Build and push meme-service image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: services
file: services/meme-service.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.MEME_SERVICE_IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true