Skip to content

Commit b56f32a

Browse files
committed
fix: automated and manual workflows
1 parent d880ca5 commit b56f32a

File tree

2 files changed

+94
-74
lines changed

2 files changed

+94
-74
lines changed

.github/workflows/automated.yml

Lines changed: 50 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,84 @@
1-
name: Automated Deployment
2-
3-
on:
1+
name: Automated Workflow
2+
"on":
43
push:
54
branches:
65
- master
7-
86
jobs:
97
about:
108
runs-on: ubuntu-latest
119
steps:
1210
- name: Checkout
1311
uses: actions/checkout@v2
14-
1512
- name: Jaid/action-sync-node-meta
1613
uses: jaid/action-sync-node-meta@v1.4.0
1714
with:
18-
direction: overwrite-github # default is overwrite-file
19-
githubToken: ${{ secrets.GITHUB }}
20-
21-
# docs:
22-
# runs-on: ubuntu-latest
23-
# steps:
24-
# - name: Checkout
25-
# uses: actions/checkout@v2
26-
27-
# - name: update documentation
28-
# uses: CoCreate-app/CoCreate-docs@master
29-
15+
direction: overwrite-github
16+
githubToken: "${{ secrets.GITHUB }}"
3017
release:
3118
runs-on: ubuntu-latest
3219
steps:
3320
- name: Checkout
3421
uses: actions/checkout@v2
35-
3622
- name: Semantic Release
3723
uses: cycjimmy/semantic-release-action@v2
3824
id: semantic
3925
with:
40-
# You can specify specifying version range for the extra plugins if you prefer.
4126
extra_plugins: |
4227
@semantic-release/changelog
4328
@semantic-release/npm
4429
@semantic-release/git
4530
@semantic-release/github
4631
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB }}
48-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator
32+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
33+
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
4934
outputs:
50-
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
51-
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
52-
53-
# package:
54-
# runs-on: ubuntu-latest
55-
# needs: release
56-
# if: needs.release.outputs.new_release_published == 'true'
57-
# env:
58-
# IMAGE: docker.pkg.github.com/cocreate-app/cocreate-docs/cocreate-docs
59-
# VERSION: ${{ needs.release.outputs.new_release_version }}
60-
# steps:
61-
# - name: Checkout repository
62-
# uses: actions/checkout@v1
63-
64-
# - name: npm login
65-
# env:
66-
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
67-
# run: >
68-
# echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >
69-
# .npmrc
70-
# - name: Login docker registry
71-
# env:
72-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73-
# run: |
74-
# docker login docker.pkg.github.com -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN}
75-
76-
# - name: Build docker image
77-
# run: docker build . -t ${IMAGE}:latest -t ${IMAGE}:${VERSION}
78-
79-
# - name: Push docker image
80-
# run: |
81-
# docker push ${IMAGE}:latest
82-
# docker push ${IMAGE}:${VERSION}
83-
84-
build:
35+
new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
36+
new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
37+
cdn:
8538
runs-on: ubuntu-latest
8639
needs: release
8740
if: needs.release.outputs.new_release_published == 'true'
8841
env:
89-
IMAGE: cocreateapps/cocreate-docs
90-
VERSION: ${{ needs.release.outputs.new_release_version }}
42+
VERSION: "${{ needs.release.outputs.new_release_version }}"
9143
steps:
92-
- uses: actions/checkout@v2
93-
- name: Login to DockerHub
94-
uses: docker/login-action@v1
95-
with:
96-
username: ${{ secrets.DOCKERHUB_USER }}
97-
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
98-
- name: docker build
99-
id: docker_build
100-
run: docker build . -t ${IMAGE}:latest -t ${IMAGE}:${VERSION}
101-
- name: docker push
102-
id: docker_push
103-
run: |
104-
docker push ${IMAGE}:latest
105-
docker push ${IMAGE}:${VERSION}
106-
# - name: Image digest
107-
# run: echo ${{ steps.docker_push.outputs.digest }}
44+
- name: Checkout
45+
uses: actions/checkout@v2
46+
- name: setup nodejs
47+
uses: actions/setup-node@v2
48+
with:
49+
node-version: 14.15.4
50+
- name: yarn install
51+
run: >
52+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >
53+
.npmrc
54+
55+
yarn install
56+
- name: yarn build
57+
run: yarn build
58+
- name: upload bundle as version
59+
uses: CoCreate-app/CoCreate-s3@master
60+
with:
61+
aws-key-id: "${{ secrets.AWSACCESSKEYID }}"
62+
aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}"
63+
bucket: testcrudbucket
64+
source: ./dist
65+
destination: "/docs/${{env.VERSION}}"
66+
acl: public-read
67+
- name: upload bundle as latest
68+
uses: CoCreate-app/CoCreate-s3@master
69+
with:
70+
aws-key-id: "${{ secrets.AWSACCESSKEYID }}"
71+
aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}"
72+
bucket: testcrudbucket
73+
source: ./dist
74+
destination: /docs/latest
75+
acl: public-read
76+
invalidations: true
77+
docs:
78+
runs-on: ubuntu-latest
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v2
10882

83+
- name: update documentation
84+
uses: CoCreate-app/CoCreate-docs@master

.github/workflows/manual.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Manual Workflow
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
invalidations:
6+
description: |
7+
If set to 'true', invalidates previous upload.
8+
default: "true"
9+
required: true
10+
11+
jobs:
12+
cdn:
13+
runs-on: ubuntu-latest
14+
env:
15+
DRY_RUN: ${{ github.event.inputs.dry_run }}
16+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
17+
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
- name: setup nodejs
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: 14.15.4
26+
- name: yarn install
27+
run: >
28+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >
29+
.npmrc
30+
31+
yarn install
32+
- name: yarn build
33+
run: yarn build
34+
- name: upload latest bundle
35+
uses: CoCreate-app/CoCreate-s3@master
36+
with:
37+
aws-key-id: "${{ secrets.AWSACCESSKEYID }}"
38+
aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}"
39+
distributionId: "${{ secrets.DISTRIBUTION_ID }}"
40+
bucket: testcrudbucket
41+
source: ./dist
42+
destination: /docs/latest
43+
acl: public-read
44+
invalidations: ${{ github.event.inputs.invalidations }}

0 commit comments

Comments
 (0)