Skip to content

Commit

Permalink
prepare public edlib 3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
emmachughes committed Nov 26, 2024
1 parent c7dec48 commit 712b7d6
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 29 deletions.
34 changes: 34 additions & 0 deletions .github/actions/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
workflow_call:
inputs:
environment:
required: true
type: string
description: The environment to deploy to
secrets:
AWS_ROLE_TO_ASSUME

jobs:
deploy:
name: Deploy to ${{ environment }}
environment: ${{ environment }}
concurrency: deploy-hub-${{ environment }}
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read

steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: eu-west-1
role-duration-seconds: 3600
role-session-name: GithubCerpusDevDeploy

- name: Re-deploy docker-compose on Elastic Beanstalk
run: |
aws elasticbeanstalk update-environment
--environment-name ${{ vars.HUB_ENVIRONMENT_NAME }}
--version-label ${{ vars.HUB_APPLICATION_VERSION }}
33 changes: 16 additions & 17 deletions .github/workflows/contentauthor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Content Author
on:
push:
branches:
- hubbub
- edlib3
paths:
- '.github/workflows/contentauthor.yaml'
- 'sourcecode/apis/contentauthor/**'
tags:
- 'v*'
pull_request:
branches:
- hubbub
- edlib3
paths:
- '.github/workflows/contentauthor.yaml'
- 'sourcecode/apis/contentauthor/**'
Expand All @@ -37,7 +37,7 @@ jobs:
run: composer validate

php-cs-fixer:
if: github.ref != 'refs/heads/hubbub'
if: github.ref != 'refs/heads/edlib3'
needs: [composer-validate]
runs-on: ubuntu-22.04

Expand Down Expand Up @@ -165,14 +165,13 @@ jobs:
test-image \
vendor/bin/phpunit --coverage-clover /reports/coverage.xml
# TODO: uncomment when repo is opened
#- name: Upload coverage to Codecov
# if: github.event_name == 'push' && github.ref != 'refs/heads/hubbub'
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: /tmp/coverage.xml
# context: sourcecode/apis/contentauthor
- name: Upload coverage to Codecov
if: github.event_name == 'push' && github.ref != 'refs/heads/edlib3'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/coverage.xml
context: sourcecode/apis/contentauthor

- name: Gather Docker metadata for PHP image
id: php_meta
Expand All @@ -181,7 +180,7 @@ jobs:
images: |
name=ghcr.io/cerpus/edlib-contentauthor
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/hubbub' }},prefix=php-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/edlib3' }},prefix=php-
type=semver,pattern={{version}},prefix=php-
type=semver,pattern={{major}}.{{minor}},prefix=php-
type=semver,pattern={{major}},prefix=php-
Expand All @@ -195,7 +194,7 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
context: sourcecode/apis/contentauthor
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/hubbub' }}
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/edlib3' }}
target: prod
tags: ${{ steps.php_meta.outputs.tags }}

Expand All @@ -206,7 +205,7 @@ jobs:
images: |
name=ghcr.io/cerpus/edlib-contentauthor
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/hubbub' }},prefix=web-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/edlib3' }},prefix=web-
type=semver,pattern={{version}},prefix=web-
type=semver,pattern={{major}}.{{minor}},prefix=web-
type=semver,pattern={{major}},prefix=web-
Expand All @@ -220,7 +219,7 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
context: sourcecode/apis/contentauthor
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/hubbub' }}
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/edlib3' }}
target: web
tags: ${{ steps.web_meta.outputs.tags }}

Expand All @@ -231,7 +230,7 @@ jobs:
deploy-eb:
name: Deploy CA to test environments
if: always() && needs.build_test_publish.result == 'success' && github.event_name == 'push' && github.ref == 'refs/heads/hubbub'
if: always() && needs.build_test_publish.result == 'success' && github.event_name == 'push' && github.ref == 'refs/heads/edlib3'
needs: [build_test_publish]
strategy:
matrix:
Expand Down Expand Up @@ -259,4 +258,4 @@ jobs:

- name: Re-deploy docker-compose on Elastic Beanstalk
run: |
aws elasticbeanstalk update-environment --environment-name ${{ vars.CA_ENVIRONMENT_NAME }} --version-label ${{ vars.CA_APPLICATION_VERSION }}
aws elasticbeanstalk update-environment --environment-name ${{ vars.CA_ENVIRONMENT_NAME }} --version-label ${{ vars.CA_APPLICATION_VERSION }}
18 changes: 9 additions & 9 deletions .github/workflows/hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Hub
on:
push:
branches:
- hubbub
- edlib3
paths:
- ".github/workflows/hub.yaml"
- "sourcecode/hub/**"
tags:
- 'v*'
pull_request:
branches:
- hubbub
- edlib3
paths:
- '.github/workflows/hub.yaml'
- 'sourcecode/hub/**'
Expand All @@ -37,7 +37,7 @@ jobs:
run: composer validate --no-check-publish

php-cs-fixer:
if: github.ref != 'refs/heads/hubbub'
if: github.ref != 'refs/heads/edlib3'
needs: [composer-validate]
runs-on: ubuntu-22.04

Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
images: |
name=ghcr.io/cerpus/edlib-hub
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/hubbub' }},prefix=php-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/edlib3' }},prefix=php-
type=semver,pattern={{version}},prefix=php-
type=semver,pattern={{major}}.{{minor}},prefix=php-
type=semver,pattern={{major}},prefix=php-
Expand All @@ -215,7 +215,7 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/buildx-cache-new,mode=max
context: sourcecode/hub
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/hubbub' }}
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/edlib3' }}
target: prod
tags: ${{ steps.php_meta.outputs.tags }}

Expand All @@ -226,7 +226,7 @@ jobs:
images: |
name=ghcr.io/cerpus/edlib-hub
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/hubbub' }},prefix=web-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/edlib3' }},prefix=web-
type=semver,pattern={{version}},prefix=web-
type=semver,pattern={{major}}.{{minor}},prefix=web-
type=semver,pattern={{major}},prefix=web-
Expand All @@ -240,7 +240,7 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
context: sourcecode/hub
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/hubbub' }}
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/edlib3' }}
target: web
tags: ${{ steps.web_meta.outputs.tags }}

Expand All @@ -251,7 +251,7 @@ jobs:
deploy-eb:
name: Deploy hub to test environments
if: always() && needs.build_test_publish.result == 'success' && github.event_name == 'push' && github.ref == 'refs/heads/hubbub'
if: always() && needs.build_test_publish.result == 'success' && github.event_name == 'push' && github.ref == 'refs/heads/edlib3'
needs: [build_test_publish]
strategy:
matrix:
Expand Down Expand Up @@ -279,4 +279,4 @@ jobs:

- name: Re-deploy docker-compose on Elastic Beanstalk
run: |
aws elasticbeanstalk update-environment --environment-name ${{ vars.HUB_ENVIRONMENT_NAME }} --version-label ${{ vars.HUB_APPLICATION_VERSION }}
aws elasticbeanstalk update-environment --environment-name ${{ vars.HUB_ENVIRONMENT_NAME }} --version-label ${{ vars.HUB_APPLICATION_VERSION }}
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ services:
redis: { condition: service_healthy }
env_file:
- ./localSetup/projects/content-author/.env
- ./localSetup/.env
command: /startup.sh
healthcheck:
test: [CMD, nc, -z, localhost, "9000"]
Expand All @@ -91,7 +90,6 @@ services:
contentauthor-fpm: { condition: service_healthy }
env_file:
- ./localSetup/projects/content-author/.env
- ./localSetup/.env
volumes:
- ./data/nginx/ca:/usr/local/share/ca-certificates:ro
- ./sourcecode/apis/contentauthor:/app
Expand All @@ -107,7 +105,6 @@ services:
redis: { condition: service_healthy }
env_file:
- ./localSetup/projects/content-author/.env
- ./localSetup/.env
volumes:
- ./data/nginx/ca:/usr/local/share/ca-certificates:ro
- ./sourcecode/apis/contentauthor:/app
Expand Down

0 comments on commit 712b7d6

Please sign in to comment.