Skip to content

Update workflows

Update workflows #10

Workflow file for this run

name: Cupcake Backend
on:
push:
paths:
- backend/**
jobs:
push:
name: "Build Cupcake backend"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Test
run: ./gradlew clean check
working-directory: backend
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: ${{ secrets.DOCKERHUB_USERNAME != '' }}

Check failure on line 32 in .github/workflows/backend.yaml

View workflow run for this annotation

GitHub Actions / Cupcake Backend

Invalid workflow file

The workflow is not valid. .github/workflows/backend.yaml (Line: 32, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.DOCKERHUB_USERNAME != '' .github/workflows/backend.yaml (Line: 36, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.DOCKERHUB_USERNAME != ''

Check failure on line 32 in .github/workflows/backend.yaml

View workflow run for this annotation

GitHub Actions / Cupcake Backend

Invalid workflow file

The workflow is not valid. .github/workflows/backend.yaml (Line: 32, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.DOCKERHUB_USERNAME != '' .github/workflows/backend.yaml (Line: 36, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.DOCKERHUB_USERNAME != ''
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
if: ${{ secrets.DOCKERHUB_USERNAME != '' }}
- name: Login to DockerHub Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
if: ${{ secrets.DOCKERHUB_USERNAME != '' }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./backend
platforms: linux/amd64,linux/arm64
push: true
tags: "${{ secrets.DOCKERHUB_USERNAME }}/cupcake:${{ github.sha }},${{ secrets.DOCKERHUB_USERNAME }}/cupcake:latest"
if: ${{ secrets.DOCKERHUB_USERNAME != '' }}
- name: Create staging
if: github.ref == 'refs/heads/main'
run: docker buildx imagetools create -t ${{ secrets.DOCKERHUB_USERNAME }}/cupcake:staging ${{ secrets.DOCKERHUB_USERNAME }}/cupcake:latest
if: ${{ secrets.DOCKERHUB_USERNAME != '' }}
- name: Upload reports if failed
if: failure()
uses: actions/upload-artifact@v4
with:
name: search-reports
path: |
backend/**/build/reports/
backend/**/build/test-results/
- name: Upload coverage if passed
if: success()
uses: actions/upload-artifact@v4
with:
name: search-coverage
path: |
backend/**/build/reports/jacoco/
- name: Generate summary
run: |
echo "Tag: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
working-directory: backend