Skip to content

Remove wrong status check conclusion in Application Build workflow #26

Remove wrong status check conclusion in Application Build workflow

Remove wrong status check conclusion in Application Build workflow #26

name: Application Build
on:
push:
paths:
- "**.css"
- "**.kt"
- "**.png"
- "**.js"
- "**.json"
- "**.snap"
- "**.ts"
- "**.tsx"
- "**.yml"
- ".github/workflows/cicd.yml"
- "infra/configurations/**.properties"
- "infra/docker/app/**"
- "**.sql"
- "backend/pom.xml"
- "backend/build.gradle.kts"
- "Makefile"
- "frontend"
schedule:
- cron: "38 11 */3 * *"
concurrency:
group: ${{ github.workflow }}-${{ github.event.push.head_commit.id }}
cancel-in-progress: true
jobs:
initialize_e2e_tests_job_check:
name: Initialize E2E Tests job checks
runs-on: ubuntu-22.04
steps:
- name: Initialize Cypress E2E Tests job check
id: initialize_cypress_e2e_tests_job_check
uses: LouisBrunner/[email protected]
with:
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}"
name: "Application E2E Tests (Cypress)"
sha: ${{ github.event.push.head_commit.id }}
status: queued
token: ${{ secrets.GITHUB_TOKEN }}
- name: Initialize Cypress E2E Tests job check
id: initialize_puppeteer_e2e_tests_job_check
uses: LouisBrunner/[email protected]
with:
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}"
name: Application E2E Tests (Puppeteer)
sha: ${{ github.event.push.head_commit.id }}
status: queued
token: ${{ secrets.GITHUB_TOKEN }}
- name: Save job check IDs
run: |
mkdir -p workflow_share
echo "${{ steps.initialize_cypress_e2e_tests_job_check.outputs.check_id }}" > workflow_share/cypress_job_check_id
echo "${{ steps.initialize_puppeteer_e2e_tests_job_check.outputs.check_id }}" > workflow_share/puppeteer_job_check_id
- uses: actions/upload-artifact@v4
with:
name: workflow_share
path: workflow_share/*
build:
name: Build and package
runs-on: ubuntu-22.04
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set version and environment profile
uses: ./.github/actions/set-version-and-environment-profile
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache-app
key: ${{ runner.os }}-single-buildx-app-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-single-buildx-app-
- name: Build image
uses: docker/build-push-action@v5
with:
context: .
load: true
builder: ${{ steps.buildx.outputs.name }}
file: infra/docker/app/Dockerfile
push: false
tags: monitorfish-app:${{ env.VERSION }}
cache-from: type=local,src=/tmp/.buildx-cache-app
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-app-new
build-args: |
IS_RELEASE=${{ env.IS_RELEASE }}
VERSION=${{ env.VERSION }}
ENV_PROFILE=${{ env.ENV_PROFILE }}
GITHUB_SHA=${{ github.sha }}
SENTRY_URL=${{ secrets.SENTRY_URL }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT=${{ secrets.SENTRY_PROJECT }}
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache-app
mv /tmp/.buildx-cache-app-new /tmp/.buildx-cache-app
- name: Upload image to artifacts
uses: ishworkh/[email protected]
with:
image: monitorfish-app:${{ env.VERSION }}