-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(automation): create ci/cd workflow
- Loading branch information
Showing
3 changed files
with
74 additions
and
134 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
name: CI | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- master | ||
|
||
jobs: | ||
updateKeyword: | ||
about: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Jaid/action-sync-node-meta | ||
uses: jaid/[email protected] | ||
with: | ||
direction: overwrite-github # default is overwrite-file | ||
githubToken: ${{ secrets.GITHUB }} | ||
|
||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: update documentation | ||
uses: CoCreate-app/CoCreate-docs@master | ||
|
||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -26,6 +35,7 @@ jobs: | |
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v2 | ||
id: semantic | ||
with: | ||
# You can specify specifying version range for the extra plugins if you prefer. | ||
extra_plugins: | | ||
|
@@ -35,15 +45,64 @@ jobs: | |
@semantic-release/github | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator | ||
|
||
docs: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Auto Changog generator | ||
outputs: | ||
new_release_published: ${{ steps.semantic.outputs.new_release_published }} | ||
new_release_version: ${{ steps.semantic.outputs.new_release_version }} | ||
|
||
package: | ||
runs-on: ubuntu-latest | ||
needs: ci | ||
if: needs.ci.outputs.new_release_published == 'true' | ||
env: | ||
IMAGE: docker.pkg.github.com/cocreate-app/cocreatews/cocreatews | ||
VERSION: ${{ needs.ci.outputs.new_release_version }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: update documentation | ||
uses: CoCreate-app/CoCreate-docs@master | ||
|
||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Login docker registry | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
docker login docker.pkg.github.com -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} | ||
- name: Build docker image | ||
run: docker build . -t ${IMAGE}:latest -t ${IMAGE}:${VERSION} | ||
|
||
- name: Push docker image | ||
run: | | ||
docker push ${IMAGE}:latest | ||
docker push ${IMAGE}:${VERSION} | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- ci | ||
- package | ||
if: needs.ci.outputs.new_release_published == 'true' | ||
env: | ||
VERSION: ${{ needs.ci.outputs.new_release_version }} | ||
KUBECONFIG_FILE: ${{ secrets.KUBECONFIG }} | ||
KUBECONFIG: kubeconfig | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Get kubectl | ||
run: | | ||
curl -LO https://dl.k8s.io/release/v1.20.0/bin/linux/amd64/kubectl | ||
chmod +x kubectl | ||
- name: Save kubeconfig | ||
env: | ||
KUBECONFIG_FILE: ${{ secrets.KUBECONFIG }} | ||
run: | | ||
echo ${KUBECONFIG_FILE} | base64 -d > ${KUBECONFIG} | ||
- name: Apply deployment | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB }} | ||
run: | | ||
sed -i "s/IMAGE_TAG/${VERSION}/g" k8s/kustomization.yaml | ||
./kubectl kustomize k8s/ | ./kubectl apply -f - |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.