From 3e9c0e4164a4f6ce359045e778074f24e0fde8c6 Mon Sep 17 00:00:00 2001 From: hosseinalipour Date: Wed, 30 Jun 2021 20:37:54 +0000 Subject: [PATCH] fix: automated and manual workflows --- .../{automation.yml => automated.yml} | 31 +------------ .github/workflows/manual.yml | 44 +++++++++++++++++++ 2 files changed, 46 insertions(+), 29 deletions(-) rename .github/workflows/{automation.yml => automated.yml} (74%) create mode 100644 .github/workflows/manual.yml diff --git a/.github/workflows/automation.yml b/.github/workflows/automated.yml similarity index 74% rename from .github/workflows/automation.yml rename to .github/workflows/automated.yml index a6aa2fc..f117fa7 100644 --- a/.github/workflows/automation.yml +++ b/.github/workflows/automated.yml @@ -1,4 +1,4 @@ -name: CI +name: Automated Workflow "on": push: branches: @@ -73,34 +73,7 @@ jobs: source: ./dist destination: /modal/latest acl: public-read - - dist: - runs-on: ubuntu-latest - needs: release - if: needs.release.outputs.new_release_published - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - name: setup nodejs - uses: actions/setup-node@v2 - with: - node-version: 14.15.4 - - name: yarn install - run: > - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > - .npmrc - - yarn install - - run: yarn build - - run: git add . - - run: git config user.email "frank@cocreate.app" - - run: git config user.name "frank pagan" - - run: git commit --allow-empty -m "add dist bundle" - - run: git pull origin master - - run: git commit --allow-empty -m "add dist bundle" - - run: git push origin master + invalidations: true docs: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 0000000..0e2bae0 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,44 @@ +name: Manual Workflow +on: + workflow_dispatch: + inputs: + invalidations: + description: | + If set to 'true', invalidates previous upload. + default: "true" + required: true + +jobs: + cdn: + runs-on: ubuntu-latest + env: + DRY_RUN: ${{ github.event.inputs.dry_run }} + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: setup nodejs + uses: actions/setup-node@v2 + with: + node-version: 14.15.4 + - name: yarn install + run: > + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > + .npmrc + + yarn install + - name: yarn build + run: yarn build + - name: upload latest bundle + uses: CoCreate-app/CoCreate-s3@master + with: + aws-key-id: "${{ secrets.AWSACCESSKEYID }}" + aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}" + distributionId: "${{ secrets.DISTRIBUTION_ID }}" + bucket: testcrudbucket + source: ./dist + destination: /modal/latest + acl: public-read + invalidations: ${{ github.event.inputs.invalidations }}