Skip to content

Commit

Permalink
fix: automated and manual workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitamin committed Jun 30, 2021
1 parent b9d114a commit 2c71ffa
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Automated Workflow
"on":
push:
branches:
Expand Down Expand Up @@ -73,34 +73,7 @@ jobs:
source: ./dist
destination: /search/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:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -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: /search/latest
acl: public-read
invalidations: ${{ github.event.inputs.invalidations }}

0 comments on commit 2c71ffa

Please sign in to comment.