Skip to content

Make requests idempotent #54

Make requests idempotent

Make requests idempotent #54

Workflow file for this run

name: Publishing
on:
push:
branches:
- develop
- release/*
- hotfix/*
tags:
- v*.*.*
env:
REGISTRY: ghcr.io
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
test-type:
- unit
env:
PLAYWRIGHT_BROWSERS_PATH: .playwright
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: lts/*
check-latest: true
cache: npm
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
check-latest: true
- name: Cache Playwright browsers
uses: actions/cache@v4
if: ${{ matrix.test-type == 'integration' }}
with:
path: .playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
if: ${{ matrix.test-type == 'integration' }}
run: npx playwright install --with-deps
- name: Generate OpenAPI client
run: npm run openapi
- name: Run tests
run: npm run test:${{ matrix.test-type }}
build:
name: Build
needs: test
runs-on: ubuntu-latest
environment: container
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=sha
type=ref,event=branch
type=edge,branch=develop
type=semver,pattern={{version}}
- name: Setup Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
build-args: |
SENTRY_ORG=${{ vars.SENTRY_ORG }}
SENTRY_PROJECT=${{ vars.SENTRY_PROJECT }}
secrets: |
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ github.repository}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true