Skip to content

Add Algorithms page #173

Add Algorithms page

Add Algorithms page #173

Workflow file for this run

name: CI
on:
push:
branches: ['main']
pull_request:
branches: ['main']
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Build docker image and run tests
run: |
docker compose build
docker compose up -d
docker compose run backend python manage.py test
docker compose down
frontend-build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'
- run: npm ci
working-directory: ./frontend
- run: npm run build --if-present
working-directory: ./frontend
- run: npm test
working-directory: ./frontend
upload-docker-images:
runs-on: ubuntu-latest
needs: [build, frontend-build]
if: github.ref == 'refs/heads/main'
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract short SHA
id: git_sha
run: echo "GIT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
- name: Build and Push Docker Backend Image
run: |
docker build -t ghcr.io/spiderpig02/galacticpathfinder-backend:${{ env.GIT_SHA }} ./backend
docker push ghcr.io/spiderpig02/galacticpathfinder-backend:${{ env.GIT_SHA }}
- name: Build and Push Docker Webapp Image
run: |
docker build -t ghcr.io/spiderpig02/galacticpathfinder-frontend:${{ env.GIT_SHA }} ./frontend
docker push ghcr.io/spiderpig02/galacticpathfinder-frontend:${{ env.GIT_SHA }}
dependabot:
permissions:
pull-requests: write
contents: write
name: 'Dependabot'
# After the other jobs complete, if one of them fails, it won't merge the PR.
needs: [build, frontend-build]
runs-on: ubuntu-latest
# Detect that the PR author is dependabot
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- name: Enable auto-merge for Dependabot PRs
# Use Github CLI to merge automatically the PR
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}