ci: 🐛 fix github branch name variable #1307
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 for pr | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- develop | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
jobs: | ||
build-backend: | ||
name: Build Backend | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-qemu-action@v3 | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./backend | ||
push: true | ||
tags: ghcr.io/dnum-mi/basegun/basegun-backend:${{ env.BRANCH_NAME }} | ||
build-frontend: | ||
name: Build Frontend | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-qemu-action@v3 | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./frontend | ||
push: true | ||
tags: ghcr.io/dnum-mi/basegun/basegun-frontend:${{ env.BRANCH_NAME }} | ||
clean-registry: | ||
name: Delete untagged images | ||
needs: [build-backend, build-frontend] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Delete from backend package | ||
uses: vlaurin/action-ghcr-prune@main | ||
with: | ||
token: ${{ secrets.PERSO_ACCESS_TOKEN }} | ||
organization: dnum-mi | ||
container: basegun/basegun-backend | ||
dry-run: false | ||
prune-untagged: true | ||
- name: Delete from frontend package | ||
uses: vlaurin/action-ghcr-prune@main | ||
with: | ||
token: ${{ secrets.PERSO_ACCESS_TOKEN }} | ||
organization: dnum-mi | ||
container: basegun/basegun-frontend | ||
dry-run: false | ||
prune-untagged: true | ||
test-backend: | ||
name: Test Backend | ||
needs: build-backend | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/dnum-mi/basegun/basegun-backend:${{ env.BRANCH_NAME }} | ||
Check failure on line 79 in .github/workflows/pr.yml GitHub Actions / CI for prInvalid workflow file
|
||
env: | ||
AWS_REGION: gra | ||
AWS_DEFAULT_REGION: gra | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
S3_URL_ENDPOINT: https://s3.gra.io.cloud.ovh.net/ | ||
S3_BUCKET_NAME: basegun-s3 | ||
EMAIL_HOST: mailpit | ||
EMAIL_PORT: 1025 | ||
OPENIDCONNECT_URL: https://token.actions.githubusercontent.com/.well-known/openid-configuration | ||
steps: | ||
- run: cd /app && pytest | ||
services: | ||
mailpit: | ||
image: axllent/mailpit | ||
ports: | ||
- 1025:1025 | ||
env: | ||
MP_SMTP_AUTH_ACCEPT_ANY: 1 | ||
MP_SMTP_AUTH_ALLOW_INSECURE: 1 | ||
test-frontend-format: | ||
name: Test Frontend Formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run Prettier check | ||
working-directory: frontend | ||
run: | | ||
npm ci | ||
npm run format-check | ||
test-e2e: | ||
name: Run E2E tests | ||
needs: [build-backend, build-frontend] | ||
uses: ./.github/workflows/test-e2e.yml |