Skip to content

Commit

Permalink
Init CD (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ya7on committed Nov 28, 2021
1 parent 04d9a8e commit a445b29
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/deploy_commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy commit

on: workflow_dispatch

jobs:

deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: 'Get version'
id: releasetag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 0.1.0
- name: Release pushed commit
run: |
curl \
-X POST \
-H "Authorization: token ${{ secrets.PERSONAL_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/donkey-engine/deploy/actions/workflows/deploy_commit.yml/dispatches \
-d '{"ref": "master", "inputs": {"commit": "${GITHUB_SHA}", "branch": "${GITHUB_REF##*/}", "repo": "wsbackend", "release": "${{ steps.releasetag.outputs.tag }}"}}'
20 changes: 20 additions & 0 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deploy release

on:
release:
types: [published]

jobs:

deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Release pushed commit
run: |
curl \
-X POST \
-H "Authorization: token ${{ secrets.PERSONAL_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/donkey-engine/deploy/actions/workflows/deploy_release.yml/dispatches \
-d '{"ref": "master", "inputs": {"repo": "wsbackend", "release": "${{ github.event.release.tag_name }}"}}'

0 comments on commit a445b29

Please sign in to comment.