Fix nginx configuration by delegating to the react router #7
Workflow file for this run
This file contains hidden or 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: Tag & Release Workflow | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to release (must start with "v")' | |
| required: true | |
| deploy: | |
| description: 'Deploy to DigitalOcean' | |
| required: false | |
| default: false | |
| type: boolean | |
| jobs: | |
| build-course-hub-backend: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| outputs: | |
| version: ${{ steps.get-version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| cache: 'gradle' | |
| - uses: docker/setup-buildx-action@v3 | |
| with: | |
| platforms: linux/amd64 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - id: get-version | |
| run: | | |
| # Determine version from tag or input | |
| VERSION="${{ inputs.version || '' }}" | |
| if [ -z "$VERSION" ]; then | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| fi | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| - name: Build | |
| env: | |
| DOCKER_PUSH: ${{ github.repository == 'HackYourFuture/CourseHub' }} | |
| run: ./gradlew -Pversion=${{ steps.get-version.outputs.version }} bootBuildImage | |
| build-course-hub-frontend: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: docker/setup-buildx-action@v3 | |
| with: | |
| platforms: linux/amd64 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - id: get-version | |
| run: | | |
| # Determine version from tag or input | |
| VERSION="${{ inputs.version || '' }}" | |
| if [ -z "$VERSION" ]; then | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| fi | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| - name: Build and push Docker image | |
| env: | |
| DOCKER_PUSH: ${{ github.repository == 'HackYourFuture/CourseHub' }} | |
| run: | | |
| docker build \ | |
| --build-arg VERSION=${VERSION} \ | |
| -t ghcr.io/hackyourfuture/course-hub-frontend:${{ steps.get-version.outputs.version }} \ | |
| -t ghcr.io/hackyourfuture/course-hub-frontend:latest \ | |
| ui | |
| if [ "$DOCKER_PUSH" = "true" ]; then | |
| docker push ghcr.io/hackyourfuture/course-hub-frontend:${{ steps.get-version.outputs.version }} | |
| docker push ghcr.io/hackyourfuture/course-hub-frontend:latest | |
| fi | |
| deploy: | |
| # do not execute on forks | |
| if: ${{ github.repository == 'HackYourFuture/CourseHub' && (github.event_name == 'push' || inputs.deploy) }} | |
| needs: [build-course-hub-backend, build-course-hub-frontend] | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/deploy-to-digital-ocean.yml | |
| secrets: inherit | |
| with: | |
| version: ${{ needs.build-image.outputs.version }} |