Groupchats #455
Workflow file for this run
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: 'Ensure Integrity' | |
on: | |
pull_request: null | |
push: | |
branches: [master] | |
env: | |
OWNER: yes-theory-fam | |
jobs: | |
docker-build-server: | |
name: "Docker Build Server" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/docker-build | |
name: "Build Container" | |
with: | |
sub-project: server | |
token: ${{ secrets.GITHUB_TOKEN }} | |
docker-build-web: | |
name: "Docker Build Web" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/docker-build | |
name: "Build Container" | |
with: | |
sub-project: web | |
token: ${{ secrets.GITHUB_TOKEN }} | |
docker-build-cms: | |
name: "Docker Build CMS" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/docker-build | |
name: "Build Container" | |
with: | |
sub-project: cms | |
token: ${{ secrets.GITHUB_TOKEN }} | |
chromatic-deployment: | |
name: "Chromatic Deployment" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/install-yarn | |
name: "Install dependencies" | |
- name: Publish to Chromatic | |
uses: chromaui/action@v1 | |
with: | |
exitZeroOnChanges: true | |
workingDir: packages/web | |
buildScriptName: storybook:build | |
token: ${{ secrets.GITHUB_TOKEN }} | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
e2e-test: | |
name: "Cypress E2E-Test" | |
needs: [ docker-build-server, docker-build-web, docker-build-cms ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Uses fake ternary operator to use latest for master and pr-# for PRs https://github.community/t/do-expressions-support-ternary-operators-to-change-their-returned-value/18114/3 | |
- name: Bake e2e test YAML | |
run: sed -i 's/COMMIT_HASH/${{ github.ref == 'refs/heads/master' && 'master' || format('pr-{0}', github.event.pull_request.number) }}/g' docker-compose.e2e.yml | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run e2e tests | |
run: | | |
docker-compose -f docker-compose.e2e.yml up --no-build -d server cms web | |
docker-compose -f docker-compose.e2e.yml run cypress | |
docker-compose -f docker-compose.e2e.yml down | |
remove-test-containers: | |
name: "Clean" | |
# Run even if e2e-test failed | |
if: ${{ always() }} | |
needs: e2e-test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Delete server image | |
uses: ./.github/actions/delete-image | |
with: | |
sub-project: server | |
token: ${{ secrets.PR_IMAGE_DELETION_SECRET }} | |
- name: Delete web image | |
uses: ./.github/actions/delete-image | |
with: | |
sub-project: web | |
token: ${{ secrets.PR_IMAGE_DELETION_SECRET }} | |
- name: Delete cms image | |
uses: ./.github/actions/delete-image | |
with: | |
sub-project: cms | |
token: ${{ secrets.PR_IMAGE_DELETION_SECRET }} |