chore(deps): bump @strapi/strapi from 4.13.7 to 4.14.0 #391
Workflow file for this run
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 | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
# Allow to run this workflow manually | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
CONTAINER_IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
test-build-strapi: | |
permissions: | |
packages: read | |
runs-on: ubuntu-latest | |
timeout-minutes: 25 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci --include=dev | |
- name: Run build | |
run: npm run build | |
- name: Run test | |
run: cp .env.example .env && npm run test | |
env: | |
NODE_ENV: test | |
build-push-image: | |
needs: [test-build-strapi] | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
permissions: | |
security-events: write | |
packages: write | |
id-token: write | |
outputs: | |
version: ${{ github.sha }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build an image from Dockerfile | |
run: | | |
docker build -t ${{ env.IMAGE_NAME }}:${{ github.sha }} . --build-arg COMMIT_SHA=${{ github.sha }} | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@fbd16365eb88e12433951383f5e99bd901fc618f | |
with: | |
image-ref: "${{ env.IMAGE_NAME }}:${{ github.sha }}" | |
format: "template" | |
template: "@/contrib/sarif.tpl" | |
output: "trivy-results.sarif" | |
ignore-unfixed: true | |
vuln-type: "os,library" | |
severity: "CRITICAL,HIGH" | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@81b419c908d540ec4c7da9bfb4b5d941fca8f624 | |
with: | |
sarif_file: "trivy-results.sarif" | |
- name: Login to container registry | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push image | |
run: | | |
docker tag ${{ env.IMAGE_NAME }}:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
docker tag ${{ env.IMAGE_NAME }}:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} | |
docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
deploy-staging: | |
needs: [build-push-image] | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
environment: staging | |
steps: | |
- name: Check out strapi infra repo | |
uses: actions/checkout@v4 | |
with: | |
repository: digitalservicebund/a2j-rechtsantragstelle-strapi-infra | |
ssh-key: ${{ secrets.DEPLOY_KEY }} | |
- name: Update image tag for staging | |
run: | | |
cd manifests/overlays/staging | |
kustomize edit set image ghcr.io/digitalservicebund/a2j-rechtsantragstelle-strapi:${{ github.sha }} | |
- name: Commit and push | |
uses: EndBug/add-and-commit@1bad3abcf0d6ec49a5857d124b0bfb52dc7bb081 | |
with: | |
add: "manifests/overlays/staging/kustomization.yaml" | |
message: "Update staging image to ${{ github.sha }}" | |
pathspec_error_handling: exitImmediately | |
push: true |