Skip to content
Snippets Groups Projects
ci.yaml 2.18 KiB
Newer Older
Stefan Freudenberg's avatar
Stefan Freudenberg committed
name: CI

on:
  push:
    branches: [ "main" ]
    paths-ignore: [ "terraform/**" ]
  pull_request:
    branches: [ "main" ]
    paths-ignore: [ "terraform/**" ]
env:
  REGISTRY: rg.fr-par.scw.cloud/knot-dots

  test:

    timeout-minutes: 60

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 18
          cache: "npm"
      - run: npm clean-install
      - run: npx playwright install --with-deps
      - run: npx playwright test
      - uses: actions/upload-artifact@v3
        if: failure()
        with:
          name: test-results
          path: test-results/
          retention-days: 7
    runs-on: ubuntu-latest

        image: [ "strategytool", "keycloak", "migrate"]
      - uses: docker/login-action@v3
          registry: ${{ env.REGISTRY }}
          username: nologin
          password: ${{ secrets.SCW_SECRET_KEY }}
      - uses: docker/build-push-action@v5
          cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ matrix.image }}:latest
          cache-to: type=inline
          file: docker/${{ matrix.image }}/Dockerfile
          target: production
          push: ${{ github.event_name == 'push' }}
            ${{ env.REGISTRY }}/${{ matrix.image }}:${{ github.sha }}
            ${{ env.REGISTRY }}/${{ matrix.image }}:latest
    if: github.event_name == 'push'

    needs: [ build ]

    runs-on: ubuntu-latest

    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v4
      - run: |
          echo 'strategytool_image = "${{ env.REGISTRY }}/strategytool:${{ github.sha }}"' > ./terraform/dev/terraform.tfvars
          echo 'keycloak_image     = "${{ env.REGISTRY }}/keycloak:${{ github.sha }}"' >> ./terraform/dev/terraform.tfvars
          echo 'migrate_image      = "${{ env.REGISTRY }}/migrate:${{ github.sha }}"' >> ./terraform/dev/terraform.tfvars
          git config --global user.name actions-user
          git config --global user.email actions@github.com
          git commit -am "Update image tag"
          git push

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.