Skip to content

deploy-rule

deploy-rule #36

Workflow file for this run

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