mirror of
https://github.com/valitydev/checkout.git
synced 2024-11-06 10:35:20 +00:00
62 lines
2.1 KiB
YAML
62 lines
2.1 KiB
YAML
name: Master
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- 'main'
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- name: Init
|
|
uses: ./.github/actions/init
|
|
- name: Build
|
|
run: npm run build
|
|
env:
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
|
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
|
- name: Deploy image
|
|
uses: valitydev/action-deploy-docker@v2
|
|
with:
|
|
registry-username: ${{ github.actor }}
|
|
registry-access-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: set config
|
|
run: |
|
|
printf "$APP_ENV_FILE" > dist/v1/appConfig.json
|
|
shell: bash
|
|
env:
|
|
APP_ENV_FILE: ${{secrets.APP_CONFIG_CF}}
|
|
- name: Publish to CF Pages
|
|
uses: cloudflare/pages-action@1
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
projectName: 'payform'
|
|
directory: 'dist'
|
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: main
|
|
- name: set v2 config
|
|
run: |
|
|
printf "$APP_2_ENV_FILE" > dist/v1/appConfig.json
|
|
shell: bash
|
|
env:
|
|
APP_2_ENV_FILE: ${{secrets.APP_2_CONFIG_CF}}
|
|
- name: Publish 2 to CF Pages
|
|
uses: cloudflare/pages-action@1
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
projectName: 'payform-2'
|
|
directory: 'dist'
|
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: main
|