Skip to content

Update to run tests on every push #24

Update to run tests on every push

Update to run tests on every push #24

name: Build Backend Docker Image
on:
push:
branches:
- master
- "backend/"
- "backend/scopeBackend"
pull_request:
branches:
- master
- "backend/"
- "backend/scopeBackend"
# these path settings ensure this workflow only executes on a push
# to this YML itself, or any file in the backend or scopeBackend folders
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# GitHub sets up this token for you
- name: Create db_config.cnf
run: echo "${{ secrets.DB_CONFIG }}" > ./backend/db_config.cnf
- name: Build and push the Docker image
run: docker build -t ghcr.io/${{ github.repository_owner }}/backend:latest ./backend
- name: Push the Docker image
run: docker push ghcr.io/${{ github.repository_owner }}/backend:latest
- name: Delete db_config.cnf
run: rm ./backend/db_config.cnf
# - name: Trigger Hurl Tests Workflow
# uses: peter-evans/repository-dispatch@v2
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# event-type: hurl-tests