Merge pull request #578 from ali-hosseini-deriv/ako/add-github-actions #6
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 | |
- 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: staging | |
- name: "Run Tests" | |
run: npm run test | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
publish_cloudflare_staging: | |
name: Publish to Cloudflare Pages Staging | |
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 | |
- uses: actions/[email protected] | |
with: | |
path: dist | |
- uses: "./.github/actions/publish_to_pages_staging" | |
with: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |