Merge pull request #572 from ali-hosseini-deriv/ako/add-github-actions #1
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: DSmartTrader Staging Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build_and_test: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 12.22 | |
- name: Install dependencies | |
uses: "./.github/actions/npm_install" | |
- name: Build Staging | |
uses: "./.github/actions/build" | |
with: | |
target: staging | |
- name: Build Translations | |
uses: "./.github/actions/build" | |
with: | |
target: translations | |
- uses: "./.github/actions/versioning" | |
with: | |
target_branch: production | |
- name: "Run Tests" | |
run: npm run test | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
publish_cloudflare_production: | |
name: Publish to Cloudflare Pages Production | |
runs-on: ubuntu-latest | |
needs: [build_and_test] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- uses: actions/[email protected] | |
with: | |
path: dist | |
- uses: "./.github/actions/publish_to_pages_production" | |
with: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |