fix(deps): update all dependencies #295
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: Deploy preview workflow | |
# The event triggers are configured as following: | |
# - on any pull request, trigger the workflow | |
# This is to avoid running the workflow twice on pull requests. | |
on: | |
pull_request: | |
jobs: | |
deploy-preview: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2.4.0 | |
id: pnpm-install | |
with: | |
run_install: false | |
- name: Setup Node (uses version in .nvmrc) | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Building application | |
run: pnpm build | |
- name: Extract branch name | |
id: branch | |
# Extract the branch name and replace `/` or `.` with `-`. | |
# ${parameter//pattern/string} | |
# Notice the double `//` to replace all occurrences. | |
run: | | |
echo "Extracting branch name ${{ github.head_ref }}" | |
branch_name=${{ github.head_ref }} | |
echo "::set-output name=name::$(echo ${branch_name//[\/|\.]/-})" | |
shell: bash | |
- name: Deploying to surge (preview) | |
run: pnpm run deploy | |
env: | |
APPLICATION_ID: ${{ secrets.APPLICATION_ID_STAGING }} | |
APPLICATION_URL: https://graphql-explorer-commercetools-${{ steps.branch.outputs.name }}.surge.sh | |
HOST_GCP_STAGING: ${{ secrets.HOST_GCP_STAGING }} | |
CTP_INITIAL_PROJECT_KEY: ${{ secrets.CYPRESS_PROJECT_KEY }} | |
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} | |
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} |