|
| 1 | +# This is a workflow that is manually triggered to deploy supported components other than applications |
| 2 | + |
| 3 | +name: Manual Deploy Workflow |
| 4 | + |
| 5 | +# Controls when the action will run. Workflow runs when manually triggered using the UI |
| 6 | +# or API. |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + # Inputs the workflow accepts. |
| 10 | + # inputs: |
| 11 | + # deploy_components: |
| 12 | + # description: | |
| 13 | + # Components to deploy separated by commas. |
| 14 | + # Support "nodeautoscaler", "lb", "keepalived". |
| 15 | + # default: 'nodeautoscaler,lb,keepalived' |
| 16 | + # required: true |
| 17 | + # dry_run: |
| 18 | + # description: | |
| 19 | + # If set to 'yes', run all deployment in dry-run mode. |
| 20 | + # Otherwise, set to 'no'. |
| 21 | + # default: 'yes' |
| 22 | + # required: true |
| 23 | + # kubectl_version: |
| 24 | + # description: 'Version of kubectl to be installed' |
| 25 | + # default: '1.19.9' |
| 26 | + # required: true |
| 27 | + # # Use following command to generate base64 code: |
| 28 | + # # cat <<EOF | base64 | tr -d '\n' | xargs echo |
| 29 | + # # <your_autoscalegroups_yaml> |
| 30 | + # # EOF |
| 31 | + # auto_scale_groups: |
| 32 | + # description: | |
| 33 | + # The auto scale groups defined in yaml to apply given as a string from base64 encoding. |
| 34 | + # See the comments in .github/workflows/manual.yml for how to get a base64 encoded yaml. |
| 35 | + # If this is set to empty, the nodeautoscaler/deploy/auto-scale-groups-configmap.yml in repo will be used. |
| 36 | + # default: '' |
| 37 | + # required: false |
| 38 | + # all_peers_ip: |
| 39 | + # description: | |
| 40 | + # The private IPs of all nodes running keepalived talked to AWS separated by comma. |
| 41 | + # For example, "10.0.0.1,10.0.0.2" |
| 42 | + # This must be non-empty if keepalived is deployed. |
| 43 | + # default: '' |
| 44 | + # required: false |
| 45 | + # eip_alloc_id: |
| 46 | + # description: | |
| 47 | + # The allocation ID of elastic IP in AWS used as the virtual IP in keepalived. |
| 48 | + # If this is set to empty, the secret EIP_ALLOC_ID will be used. |
| 49 | + # default: '' |
| 50 | + # required: false |
| 51 | + # aws_default_region: |
| 52 | + # description: | |
| 53 | + # The default AWS region connected by keepalived. This must match the granted permission |
| 54 | + # to AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY stored in secrets. |
| 55 | + # default: 'us-east-1' |
| 56 | + # required: true |
| 57 | + # primary_nic_name: |
| 58 | + # description: | |
| 59 | + # The primary NIC on the host that will be assigned VIP by keepalived. |
| 60 | + # default: 'ens5' |
| 61 | + # required: true |
| 62 | + # rancher_url: |
| 63 | + # description: | |
| 64 | + # The URL of target rancher when node auto scaler uses Rancher as backend node provisioner. |
| 65 | + # If set to empty, the value of secret RANCHER_URL will be used |
| 66 | + # default: '' |
| 67 | + # required: false |
| 68 | + |
| 69 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 70 | +jobs: |
| 71 | + # Deploy components |
| 72 | + cdn: |
| 73 | + runs-on: ubuntu-latest |
| 74 | + needs: release |
| 75 | + if: needs.release.outputs.new_release_published == 'true' |
| 76 | + env: |
| 77 | + VERSION: '${{ needs.release.outputs.new_release_version }}' |
| 78 | + steps: |
| 79 | + - name: Checkout |
| 80 | + uses: actions/checkout@v2 |
| 81 | + - name: setup nodejs |
| 82 | + uses: actions/setup-node@v2 |
| 83 | + with: |
| 84 | + node-version: 14.15.4 |
| 85 | + - name: yarn install |
| 86 | + run: > |
| 87 | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > |
| 88 | + .npmrc |
| 89 | +
|
| 90 | + yarn install |
| 91 | + - name: yarn build |
| 92 | + run: yarn build |
| 93 | + - name: upload bundle as version |
| 94 | + uses: CoCreate-app/CoCreate-s3@master |
| 95 | + with: |
| 96 | + aws-key-id: '${{ secrets.AWSACCESSKEYID }}' |
| 97 | + aws-access-key: '${{ secrets.AWSSECERTACCESSKEY }}' |
| 98 | + bucket: testcrudbucket |
| 99 | + source: ./dist |
| 100 | + destination: '/${{env.VERSION}}' |
| 101 | + acl: public-read |
| 102 | + - name: upload bundle as latest |
| 103 | + uses: CoCreate-app/CoCreate-s3@master |
| 104 | + with: |
| 105 | + aws-key-id: '${{ secrets.AWSACCESSKEYID }}' |
| 106 | + aws-access-key: '${{ secrets.AWSSECERTACCESSKEY }}' |
| 107 | + distributionId: '${{ secrets.DISTRIBUTION_ID }}' |
| 108 | + bucket: testcrudbucket |
| 109 | + source: ./dist |
| 110 | + destination: /latest |
| 111 | + acl: public-read |
| 112 | + invalidations: true |
| 113 | + dist: |
| 114 | + runs-on: ubuntu-latest |
| 115 | + needs: release |
| 116 | + if: needs.release.outputs.new_release_published |
| 117 | + steps: |
| 118 | + - name: Checkout |
| 119 | + uses: actions/checkout@v2 |
| 120 | + with: |
| 121 | + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' |
| 122 | + - name: setup nodejs |
| 123 | + uses: actions/setup-node@v2 |
| 124 | + with: |
| 125 | + node-version: 14.15.4 |
| 126 | + - run: git pull origin master |
| 127 | + - name: yarn install |
| 128 | + run: > |
| 129 | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > |
| 130 | + .npmrc |
| 131 | +
|
| 132 | + yarn install --no-lockfile |
| 133 | + - run: yarn build |
| 134 | + - run: git add . |
| 135 | + - run: git config user.email "frank@cocreate.app" |
| 136 | + - run: git config user.name "frank pagan" |
| 137 | + - run: git commit --allow-empty -m "add dist bundle" |
| 138 | + - run: git push origin master |
0 commit comments