chore: add default paths to build step #19
Workflow file for this run
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: CI | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
- '!main' | ||
jobs: | ||
ci: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
- name: Install dependencies | ||
run: yarn install | ||
- name: Extract Branch Name | ||
id: extract-branch | ||
run: | | ||
echo BRANCH_NAME=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | perl -pe 's/\W/-/g and s/-+$//g') >> $GITHUB_OUTPUT | ||
- name: Check If DNS Record Exists | ||
id: cloudflare-dns-check | ||
uses: fjogeleit/http-request-action@v1 | ||
with: | ||
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records?name=${{steps.extract-branch.outputs.BRANCH_NAME}}.cfi-fingerprint.com' | ||
method: 'GET' | ||
customHeaders: '{"X-Auth-Email": "${{ secrets.CF_AUTH_EMAIL }}", "Authorization": "Bearer ${{ secrets.CF_AUTH_TOKEN }}"}' | ||
- name: Create Cloudflare DNS Record | ||
if: ${{ fromJson(steps.cloudflare-dns-check.outputs.response).result_info.total_count < 1 }} | ||
uses: fjogeleit/http-request-action@v1 | ||
with: | ||
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records' | ||
method: 'POST' | ||
customHeaders: '{"X-Auth-Email": "${{ secrets.CF_AUTH_EMAIL }}", "Authorization": "Bearer ${{ secrets.CF_AUTH_TOKEN }}"}' | ||
data: '{"content": "${{steps.extract-branch.outputs.BRANCH_NAME}}.cfi-fingerprint.com.edgesuite.net", "name": "${{steps.extract-branch.outputs.BRANCH_NAME}}.cfi-fingerprint.com", "proxied": false, "type": "CNAME", "comment": "Akamai CI run for ${{steps.extract-branch.outputs.BRANCH_NAME}}", "ttl": 3600, "tags": ["owner:akamai-integration-ci"]}' | ||
- name: Check Akamai Property can be created | ||
id: check-akamai-property | ||
continue-on-error: true | ||
env: | ||
BRANCH_NAME: '${{steps.extract-branch.outputs.BRANCH_NAME}}' | ||
AK_HOST: '${{secrets.AK_HOST}}' | ||
AK_CLIENT_TOKEN: '${{secrets.AK_CLIENT_TOKEN}}' | ||
AK_CLIENT_SECRET: '${{secrets.AK_CLIENT_SECRET}}' | ||
AK_ACCESS_TOKEN: '${{secrets.AK_ACCESS_TOKEN}}' | ||
AK_GROUP_ID: '${{secrets.AK_GROUP_ID}}' | ||
AK_CONTRACT_ID: '${{secrets.AK_CONTRACT_ID}}' | ||
run: yarn ts-node scripts/checkPropertyCanBeCreated.ts | ||
- name: Create Akamai Property | ||
if: steps.check-akamai-property.outcome == 'success' | ||
id: create-akamai-property | ||
env: | ||
BRANCH_NAME: '${{steps.extract-branch.outputs.BRANCH_NAME}}' | ||
AK_HOST: '${{secrets.AK_HOST}}' | ||
AK_CLIENT_TOKEN: '${{secrets.AK_CLIENT_TOKEN}}' | ||
AK_CLIENT_SECRET: '${{secrets.AK_CLIENT_SECRET}}' | ||
AK_ACCESS_TOKEN: '${{secrets.AK_ACCESS_TOKEN}}' | ||
AK_GROUP_ID: '${{secrets.AK_GROUP_ID}}' | ||
AK_CONTRACT_ID: '${{secrets.AK_CONTRACT_ID}}' | ||
run: yarn ts-node scripts/createProperty.ts | ||
- name: Build Patch Body | ||
run: yarn build --type patchBody --proxy-secret ${{ FPJS_PROXY_SECRET }} --integration-path worker --agent-path pxdownload --result-path pxresult | ||
Check failure on line 64 in .github/workflows/ci.yml GitHub Actions / CIInvalid workflow file
Check failure on line 64 in .github/workflows/ci.yml GitHub Actions / CIInvalid workflow file
|
||
- name: Deploy Akamai Rules | ||
id: deploy-rules | ||
env: | ||
BRANCH_NAME: '${{steps.extract-branch.outputs.BRANCH_NAME}}' | ||
AK_HOST: '${{secrets.AK_HOST}}' | ||
AK_CLIENT_TOKEN: '${{secrets.AK_CLIENT_TOKEN}}' | ||
AK_CLIENT_SECRET: '${{secrets.AK_CLIENT_SECRET}}' | ||
AK_ACCESS_TOKEN: '${{secrets.AK_ACCESS_TOKEN}}' | ||
AK_GROUP_ID: '${{secrets.AK_GROUP_ID}}' | ||
AK_CONTRACT_ID: '${{secrets.AK_CONTRACT_ID}}' | ||
run: yarn ts-node scripts/deployRules.ts |