Update dependency cypress to v12.17.0 #461
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: Build branch and run tests | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build-test-publish: | |
runs-on: ubuntu-latest | |
steps: | |
# Configuration | |
- name: set image path | |
id: tag | |
run: | | |
if [ "main" == $GITHUB_REF_NAME ] | |
then | |
IMAGE_TAG=latest | |
else | |
IMAGE_TAG=$(echo ${GITHUB_REF_NAME} | md5sum | awk '{print $1}') | |
fi | |
IMAGE_NAME=$(echo ghcr.io/${GITHUB_REPOSITORY}/webkeyfinder | tr '[:upper:]' '[:lower:]') | |
echo "image_name=${IMAGE_NAME}" >> $GITHUB_ENV | |
echo "image_path=${IMAGE_NAME}:${IMAGE_TAG}" >> $GITHUB_ENV | |
# Setup Docker | |
- name: set up docker buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
install: true | |
- name: login container registry | |
run: docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} ghcr.io | |
- uses: actions/checkout@v3 | |
- name: pull docker image | |
run: | | |
docker pull ${{ env.image_name }}:latest | |
docker pull ${{ env.image_path }} || true | |
- name: build docker image | |
run: > | |
DOCKER_BUILDKIT=1 | |
docker build | |
--load | |
--cache-from ${{ env.image_name }}:latest,${{ env.image_path }} | |
--build-arg BUILDKIT_INLINE_CACHE=1 | |
--tag ${{ env.image_path }} . | |
- name: push docker image | |
run: docker push ${{ env.image_path }} | |
- name: run image | |
run: docker run -d -p 3000:3000 ${{ env.image_path }} | |
- name: run cypress | |
uses: cypress-io/github-action@v3.1.0 | |
with: | |
browser: chromium | |
install-command: yarn install --immutable --immutable-cache | |
command-prefix: yarn dlx | |
config-file: cypress.config.mjs | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: cypress-output | |
path: | | |
cypress/screenshots | |
cypress/videos |