[University] Type AllProgressStats response and request #1502
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: 'Test and release to staging' | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/actions/**' | |
- '.github/workflows/staging.yaml' | |
- '.github/workflows/test.yaml' | |
- 'cypress/**' | |
- 'cypress.config.json' | |
- 'services/**' | |
- '!services/backend/src/rapodiff/**' | |
- 'updater/sis-updater-worker/src/db/migrations/**' | |
- 'docker-compose.ci.yml' | |
- 'package*.json' | |
jobs: | |
test: | |
uses: ./.github/workflows/test.yaml | |
secrets: | |
username: ${{ secrets.TOSKAREGISTRY_USERNAME }} | |
password: ${{ secrets.TOSKAREGISTRY_PASSWORD }} | |
release_frontend: | |
name: 'Build and release frontend' | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get current time | |
id: get_current_time | |
run: echo "NOW=$(date --iso-8601=seconds)" >> $GITHUB_OUTPUT | |
- name: Build frontend image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: oodikone-frontend | |
tags: staging ${{ github.sha }} | |
context: services | |
containerfiles: | | |
services/frontend/Dockerfile | |
build-args: | | |
BUILT_AT=${{ steps.get_current_time.outputs.NOW }} | |
BASE_PATH=/oodikone | |
STAGING=true | |
- name: Push to quay.io | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: quay.io/toska | |
username: toska+github | |
password: ${{ secrets.QUAY_IO_TOKEN }} | |
release_backend: | |
name: 'Build and release backend' | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build backend image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: oodikone-backend | |
tags: staging ${{ github.sha }} | |
context: services | |
containerfiles: | | |
services/backend/Dockerfile | |
build-args: | | |
BASE_PATH=/oodikone | |
GIT_SHA=${{ github.sha }} | |
STAGING=true | |
- name: Push to quay.io | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: quay.io/toska | |
username: toska+github | |
password: ${{ secrets.QUAY_IO_TOKEN }} | |
report_success: | |
name: 'Report deployment success to the "oodikone_notifications" channel' | |
runs-on: ubuntu-latest | |
needs: | |
- release_frontend | |
- release_backend | |
if: success() | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 'Send notification to Slack' | |
uses: UniversityOfHelsinkiCS/[email protected] | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
message-type: deployment | |
softa-url: https://toska-staging.cs.helsinki.fi/oodikone | |
deployment-target: staging | |
report_failure: | |
name: 'Report deployment failure to the "oodikone_notifications" channel' | |
runs-on: ubuntu-latest | |
needs: | |
- release_frontend | |
- release_backend | |
if: failure() | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 'Send notification to Slack' | |
uses: UniversityOfHelsinkiCS/[email protected] | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
message-type: deployment-failure | |
deployment-target: staging |