ci: fix release, change git user #100
This file contains hidden or 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 production | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| EXPO_APPLE_TEAM_TYPE: INDIVIDUAL | |
| EXPO_APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
| GH_TOKEN: ${{ secrets.PUSH_TO_PROTECTED_TOKEN }} | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| name: Publish a release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18.x | |
| - name: Setup Git user | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PUSH_TO_PROTECTED_TOKEN }} | |
| run: | | |
| git config user.name "Vitalii Yehorov" | |
| git config user.email "[email protected]" | |
| git remote rm origin | |
| git remote add origin https://vitalyiegorov:${GITHUB_TOKEN}@github.com/rnw-community/rnw-community.git | |
| git fetch | |
| git branch --set-upstream-to=origin/main main | |
| - name: Install dependencies | |
| env: | |
| YARN_ENABLE_IMMUTABLE_INSTALLS: true | |
| run: yarn install | |
| - name: Publish a release | |
| run: yarn release | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.PUSH_TO_PROTECTED_TOKEN }} | |
| web-deploy: | |
| name: Install and build Web | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18.x | |
| - name: Install Vercel CLI | |
| run: npm install --global vercel@latest | |
| - name: Install dependencies | |
| run: yarn install && yarn build | |
| - name: Build expo web | |
| run: npx expo export --platform=web | |
| - name: Deploy to Vercel | |
| working-directory: ./dist | |
| run: | | |
| echo "!node_modules" > .vercelignore | |
| cp ../vercel.json . | |
| vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
| vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }} | |
| expo-build: | |
| name: Build and Deploy IOS and Android | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18.x | |
| - name: Setup Expo and EAS | |
| uses: expo/expo-github-action@v8 | |
| with: | |
| eas-version: latest | |
| token: ${{ secrets.EXPO_TOKEN }} | |
| - name: ASC API Key file creation | |
| uses: MobileDevOps/[email protected] | |
| with: | |
| base64-encoded-secret: ${{ secrets.EXPO_IOS_ASC_API_KEY }} | |
| filename: "asc_api_key.p8" | |
| - name: Play Market Console Key file creation | |
| uses: MobileDevOps/[email protected] | |
| with: | |
| base64-encoded-secret: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }} | |
| filename: "google-service-account.json" | |
| - name: Install dependencies | |
| run: yarn install && yarn build | |
| - name: Build on EAS | |
| working-directory: packages/app | |
| run: eas build --platform all --non-interactive --auto-submit --no-wait |