DeFiCh/wallet

View on GitHub
.github/workflows/expo-preview.yml

Summary

Maintainability
Test Coverage
name: Expo PR Preview

on:
  pull_request:
    paths-ignore:
      - "**.md"

concurrency:
  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  publish-preview:
    if: github.event.sender.type == 'User' && github.event.pull_request.head.repo.full_name == github.repository
    name: Publish Preview
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
      - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
        with:
          node-version: 20
          cache: "npm"

      - uses: expo/expo-github-action@4479f0b3692e25169fa71a02c30d6586ec2f5601 # tag=v7.2.0
        with:
          expo-version: latest
          eas-version: latest
          expo-cache: true
          eas-cache: true
          packager: npm
          token: ${{ secrets.EXPO_TOKEN }}

      - run: npm ci
      - run: eas update --branch pr-${{ github.ref_name }} --message 'Update with commit ${{ github.sha }}'
        env:
          EAS_PROJECT_ID: ${{ secrets.EAS_PROJECT_ID }}

      - uses: marocchino/sticky-pull-request-comment@f61b6cf21ef2fcc468f4345cdfcc9bda741d2343 # v2.6.2
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          header: wallet-preview
          message: |
            Build preview for DeFiChain Wallet is ready!

            Built with commit ${{ github.sha }}

            https://expo.io/@defichain/wallet?release-channel=pr-preview-${{ github.event.number }}