-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (49 loc) · 1.85 KB
/
deploy_rule.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Publish rule
on:
repository_dispatch:
types:
- deploy-rule
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
concurrency: nightly-build-rule
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
repository: immersive-translate/next-translator
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
- name: Clone repo
run: git clone https://[email protected]/immersive-translate/config repo
env:
PERSONAL_GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.34.3
- name: test
run: make test
- id: set_var
run: |
content=`cat ./manifest.json`
echo "::set-output name=version::$(echo $content | jq -r '.version')"
- name: add buildinConfigUpdatedAt field to repo/dist/default_config.json
run: make generateconfig target=repo/dist/default_config.json
- name: commit
env:
PERSONAL_GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
run: |
cd repo
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# check is there is git tag with the same version
# if not then create a new tag
git add dist/default_config.json
git commit -m "update default_config.json"
# echo v${{ steps.set_var.outputs.version }}
# git tag -l | grep v${{ steps.set_var.outputs.version }} || echo "yes"
# git tag -l | grep v${{ steps.set_var.outputs.version }} || git tag -a v${{ steps.set_var.outputs.version }} -m "v${{ steps.set_var.outputs.version }}"
# git tag -l
git remote -v
git push