Copy node-utils into ltiapi, improve logging, remove bad tests (#2756) #751
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: "Create release" | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseName: | |
description: 'Name of release' | |
required: false | |
default: '' | |
push: | |
branches: | |
- master | |
jobs: | |
get_variables: | |
if: ${{ github.event_name != 'push' || github.actor != 'dependabot[bot]' }} | |
runs-on: ubuntu-latest | |
outputs: | |
releaseRef: ${{ steps.get_ref.outputs.releaseRef }} | |
steps: | |
- name: Get the ref | |
id: get_ref | |
run: | | |
ref="${{ github.sha }}" | |
if [ -n "${{ github.event.inputs.releaseName }}" ]; then | |
if ! [[ "${{ github.event.inputs.releaseName }}" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then | |
echo "version is not semver" | |
exit 1 | |
fi | |
ref="${{ github.event.inputs.releaseName }}" | |
fi | |
echo "releaseRef=$ref" >> $GITHUB_OUTPUT | |
# ---------- APIS ----------------- | |
release_api_auth: | |
needs: get_variables | |
uses: cerpus/Edlib/.github/workflows/api-auth.yaml@master | |
with: | |
versionToRelease: ${{ needs.get_variables.outputs.releaseRef }} | |
secrets: | |
AWS_DOCKER_REGISTRY_ACCESS_KEY_ID: ${{ secrets.AWS_DOCKER_REGISTRY_ACCESS_KEY_ID }} | |
AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY }} | |
release_api_common: | |
needs: get_variables | |
uses: cerpus/Edlib/.github/workflows/api-common.yaml@master | |
with: | |
versionToRelease: ${{ needs.get_variables.outputs.releaseRef }} | |
secrets: | |
AWS_DOCKER_REGISTRY_ACCESS_KEY_ID: ${{ secrets.AWS_DOCKER_REGISTRY_ACCESS_KEY_ID }} | |
AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY }} | |
release_api_contentauthor: | |
needs: get_variables | |
uses: cerpus/Edlib/.github/workflows/api-contentauthor.yaml@master | |
with: | |
versionToRelease: ${{ needs.get_variables.outputs.releaseRef }} | |
secrets: | |
AWS_DOCKER_REGISTRY_ACCESS_KEY_ID: ${{ secrets.AWS_DOCKER_REGISTRY_ACCESS_KEY_ID }} | |
AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY }} | |
release_api_lti: | |
needs: get_variables | |
uses: cerpus/Edlib/.github/workflows/api-lti.yaml@master | |
with: | |
versionToRelease: ${{ needs.get_variables.outputs.releaseRef }} | |
secrets: | |
AWS_DOCKER_REGISTRY_ACCESS_KEY_ID: ${{ secrets.AWS_DOCKER_REGISTRY_ACCESS_KEY_ID }} | |
AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY }} | |
release_api_resources: | |
needs: get_variables | |
uses: cerpus/Edlib/.github/workflows/api-resources.yaml@master | |
with: | |
versionToRelease: ${{ needs.get_variables.outputs.releaseRef }} | |
secrets: | |
AWS_DOCKER_REGISTRY_ACCESS_KEY_ID: ${{ secrets.AWS_DOCKER_REGISTRY_ACCESS_KEY_ID }} | |
AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY }} | |
# ---------- Proxies ----------------- | |
release_proxy_admin: | |
needs: get_variables | |
uses: cerpus/Edlib/.github/workflows/proxy-admin.yaml@master | |
with: | |
versionToRelease: ${{ needs.get_variables.outputs.releaseRef }} | |
secrets: | |
AWS_DOCKER_REGISTRY_ACCESS_KEY_ID: ${{ secrets.AWS_DOCKER_REGISTRY_ACCESS_KEY_ID }} | |
AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY }} | |
release_proxy_auth: | |
needs: get_variables | |
uses: cerpus/Edlib/.github/workflows/proxy-auth.yaml@master | |
with: | |
versionToRelease: ${{ needs.get_variables.outputs.releaseRef }} | |
secrets: | |
AWS_DOCKER_REGISTRY_ACCESS_KEY_ID: ${{ secrets.AWS_DOCKER_REGISTRY_ACCESS_KEY_ID }} | |
AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY }} | |
release_proxy_lti: | |
needs: get_variables | |
uses: cerpus/Edlib/.github/workflows/proxy-lti.yaml@master | |
with: | |
versionToRelease: ${{ needs.get_variables.outputs.releaseRef }} | |
secrets: | |
AWS_DOCKER_REGISTRY_ACCESS_KEY_ID: ${{ secrets.AWS_DOCKER_REGISTRY_ACCESS_KEY_ID }} | |
AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY }} | |
release_proxy_resource: | |
needs: get_variables | |
uses: cerpus/Edlib/.github/workflows/proxy-resource.yaml@master | |
with: | |
versionToRelease: ${{ needs.get_variables.outputs.releaseRef }} | |
secrets: | |
AWS_DOCKER_REGISTRY_ACCESS_KEY_ID: ${{ secrets.AWS_DOCKER_REGISTRY_ACCESS_KEY_ID }} | |
AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY }} | |
# ------------ www --------------- | |
release_www: | |
needs: get_variables | |
uses: cerpus/Edlib/.github/workflows/www.yaml@master | |
with: | |
versionToRelease: ${{ needs.get_variables.outputs.releaseRef }} | |
secrets: | |
AWS_DOCKER_REGISTRY_ACCESS_KEY_ID: ${{ secrets.AWS_DOCKER_REGISTRY_ACCESS_KEY_ID }} | |
AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCKER_REGISTRY_SECRET_ACCESS_KEY }} | |
building_done: | |
runs-on: ubuntu-latest | |
needs: | |
- release_api_auth | |
- release_api_common | |
- release_api_contentauthor | |
- release_api_lti | |
- release_api_resources | |
- release_proxy_admin | |
- release_proxy_auth | |
- release_proxy_lti | |
- release_proxy_resource | |
- release_www | |
steps: | |
- name: "Done building images" | |
run: | | |
echo "Done building images" | |
create_release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
if: github.event.inputs.releaseName != '' | |
needs: | |
- building_done | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Create tag | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ github.token }} | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: "refs/tags/${{ github.event.inputs.releaseName }}", | |
sha: context.sha | |
}) | |
auto_deploy: | |
needs: | |
- building_done | |
- get_variables | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.actor != 'dependabot[bot]' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
environment: | |
- cerpus_test | |
environment: ${{ matrix.environment }} | |
concurrency: deploy-${{ matrix.environment }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Deploy | |
uses: ./.github/actions/awsDeploy | |
with: | |
version: ${{ needs.get_variables.outputs.releaseRef }} | |
environment: ${{ matrix.environment }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_ROLE_TO_ASSUME: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
AWS_EKS_CLUSTER_NAME: ${{ secrets.AWS_EKS_CLUSTER_NAME }} | |
SLACK_HOOK_URL: ${{ secrets.SLACK_HOOK_URL }} | |
EXTRA_SLACK_HOOK_URL: ${{ secrets.EXTRA_SLACK_HOOK_URL }} |