Skip to content

PLFM-8554: Run Synapse Docker registry using ECS #13

PLFM-8554: Run Synapse Docker registry using ECS

PLFM-8554: Run Synapse Docker registry using ECS #13

Workflow file for this run

name: main
on:
pull_request:
branches: ['*']
push:
branches: ['*']
concurrency: ci-${{ github.ref }}
env:
branch: ${{ github.head_ref || github.ref_name }}
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Static Analysis
uses: pre-commit/[email protected]
- name: Install dependencies
run: pip install -r requirements.txt -r requirements-dev.txt
- name: Run unit tests
run: python -m pytest tests/ -s -v
# make sure tests pass for both dev and prod stacks
synth-test:
needs: tests
strategy:
matrix:
stack: ['dev', 'prod']
uses: "./.github/workflows/synth-test.yml"
with:
CONTEXT: ${{ matrix.stack }}
build-registry-container:
needs: [tests, synth-test]
if: ${{ env.branch }} == 'dev' || ${{ env.branch }} == 'prod'

Check failure on line 43 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / main

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 43, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.branch .github/workflows/main.yml (Line: 78, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.branch == 'dev'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ghcr.io/${{ github.repository }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: create self-signed cert
run: >
openssl req -x509 -days 3650 -newkey rsa:2048 -sha256
-nodes -keyout privatekey.pem -out certificate.pem
-subj "/C=US/ST=Seattle/L=WA/O=SageBionetworks/OU=IT/CN=synapse.org"
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
build-args: stack=${{ env.branch }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cdk-deploy-dev:
if: ${{env.branch == 'dev'}}
needs: [tests, synth-test, build-registry-container]
uses: "./.github/workflows/aws-deploy.yml"
secrets: inherit
with:
CONTEXT: ${{ env.branch }}
ROLE_TO_ASSUME: arn:aws:iam::449435941126:role/sagebase-github-oidc-sage-bionetworks-synapse-docker-registry
cdk-deploy-prod:
if: ${{env.branch == 'prod'}}
needs: [tests, synth-test, build-registry-container]
uses: "./.github/workflows/aws-deploy.yml"
secrets: inherit
with:
CONTEXT: ${{ env.branch }}
ROLE_TO_ASSUME: arn:aws:iam::325565585839:role/sagebase-github-oidc-sage-bionetworks-synapse-docker-registry