chore(deps): Bump certifi from 2023.7.22 to 2024.7.4 in /performance #1477
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: Build & Publish | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build-services: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
service: [restaurant, order, payment, delivery, query, saga] | |
defaults: | |
run: | |
working-directory: ${{ matrix.service }} | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: corretto | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: 8.7 | |
- name: Build with Gradle | |
run: ./gradlew build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }}/${{ matrix.service }} | |
tags: | | |
type=sha | |
type=semver,pattern={{version}} | |
type=raw,value=latest | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./${{ matrix.service }} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 | |
build-shared: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: shared | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: corretto | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: 8.7 | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Set TAG version | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: echo "VERSION=${GITHUB_REF_NAME:1}" >> $GITHUB_ENV | |
- name: Set SHA version | |
if: "!startsWith(github.ref, 'refs/tags/v')" | |
run: echo "VERSION=sha-${GITHUB_SHA::7}" >> $GITHUB_ENV | |
- name: Publish with Gradle | |
run: ./gradlew -Pversion="${{ env.VERSION }}" publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-frontend: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: frontend | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Download dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
# - name: Type check | |
# run: npm run typecheck --if-present | |
# - name: Run vitest | |
# run: npm run test -- --coverage | |
- name: Copy test env vars | |
run: cp .env.example .env | |
- name: Build | |
run: npm run build | |
# - name: Cypress run | |
# uses: cypress-io/github-action@v5 | |
# with: | |
# start: npm run start:mocks | |
# wait-on: "http://localhost:8811" | |
# working-directory: ./frontend | |
# env: | |
# PORT: "8811" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }}/frontend | |
tags: | | |
type=sha | |
type=semver,pattern={{version}} | |
type=raw,value=latest | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./frontend | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64 | |
deploy: | |
# if: ${{ false }} # disable for now | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: [ build-services, build-shared, build-frontend ] | |
environment: staging | |
permissions: | |
id-token: write | |
contents: read | |
actions: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/setup-kubectl@v3 | |
- uses: azure/k8s-set-context@v3 | |
with: | |
method: kubeconfig | |
kubeconfig: ${{ secrets.KUBECONFIG }} | |
- name: Set TAG version | |
run: echo "VERSION=${GITHUB_REF_NAME:1}" >> $GITHUB_ENV | |
- uses: Azure/k8s-deploy@v4 | |
with: | |
namespace: 'thesis' | |
action: deploy | |
strategy: basic | |
manifests: | | |
k8s/main/restaurant-service-deployment.yaml | |
k8s/main/delivery-service-deployment.yaml | |
k8s/main/order-service-deployment.yaml | |
k8s/main/payment-service-deployment.yaml | |
k8s/main/query-service-deployment.yaml | |
k8s/main/saga-service-deployment.yaml | |
k8s/main/frontend-deployment.yaml | |
images: | | |
ghcr.io/bartlomiejrasztabiga/thesis/restaurant:${{ env.VERSION }} | |
ghcr.io/bartlomiejrasztabiga/thesis/delivery:${{ env.VERSION }} | |
ghcr.io/bartlomiejrasztabiga/thesis/order:${{ env.VERSION }} | |
ghcr.io/bartlomiejrasztabiga/thesis/payment:${{ env.VERSION }} | |
ghcr.io/bartlomiejrasztabiga/thesis/query:${{ env.VERSION }} | |
ghcr.io/bartlomiejrasztabiga/thesis/saga:${{ env.VERSION }} | |
ghcr.io/bartlomiejrasztabiga/thesis/frontend:${{ env.VERSION }} |