Newer
Older
env:
REGISTRY: rg.fr-par.scw.cloud/knot-dots
test:
timeout-minutes: 60
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.32.0-focal
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npx playwright test
- uses: actions/upload-artifact@v3
if: failure()
with:
name: test-results
path: test-results/
retention-days: 7
needs: [ test ]
strategy:
matrix:
image: [ "strategytool", "keycloak"]
- uses: docker/login-action@v2
with:
username: nologin
password: ${{ secrets.SCW_SECRET_KEY }}
- uses: docker/build-push-action@v4
with:
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ matrix.image }}:latest
file: docker/app/Dockerfile
push: ${{ github.event_name == 'push' }}
${{ env.REGISTRY }}/${{ matrix.image }}:${{ github.sha }}
${{ env.REGISTRY }}/${{ matrix.image }}:latest
update:
needs: [ build ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- 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
git config --global user.name actions-user
git config --global user.email actions@github.com
git commit -am "Update image tag"
git push