[api] return 202
on successful CSR submit
#15
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: Build and publish docker image | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "master" | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- "master" | |
jobs: | |
docker: | |
permissions: | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Login to Container registry | |
if: github.actor != 'dependabot[bot]' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set APP_VERSION env | |
run: echo "APP_VERSION=$(echo "${GITHUB_REF}" | rev | cut -d'/' -f 1 | rev)" >> "${GITHUB_ENV}" | |
- name: Set APP_RELEASE env | |
run: | | |
START_DATE="2025-01-23T00:00:00Z" | |
echo "APP_RELEASE=$(( ($(date -u +%s) - $(date -u -d "${START_DATE}" +%s)) / 86400 ))" >> "${GITHUB_ENV}" | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
build-args: | | |
APP_VERSION=${{ env.APP_VERSION }} | |
APP_RELEASE_ID=${{ env.APP_RELEASE }} | |
push: ${{ github.actor != 'dependabot[bot]' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
deploy: | |
needs: docker | |
runs-on: ubuntu-latest | |
environment: production | |
concurrency: production | |
env: | |
DEPLOY_WEBHOOK_URL: ${{ secrets.DEPLOY_WEBHOOK_URL }} | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
steps: | |
- name: Trigger Deploy webhook | |
if: ${{ env.DEPLOY_WEBHOOK_URL != '' }} | |
run: | | |
curl -X POST "${DEPLOY_WEBHOOK_URL}" \ | |
--fail \ | |
--silent \ | |
--show-error \ | |
--max-time 10 \ | |
--retry 3 \ | |
--retry-delay 5 \ | |
|| exit 1 |