name: Deployed Dev run-name: Deploying ${{ github.ref_name }} to ${{ github.event.inputs.env || 'dev' }} on: # workflow_run: Doesn't work in gitea # workflows: [Update Repo Version] # types: # - completed push: tags: - 'v[0-9]+.[0-9]+.[0-9]+' # Push events to every tag workflow_dispatch: # inputs: # version: # type: string # description: Version of cs-repo to deploy # required: false # nm-dev: # type: boolean # description: Deploy to dev? # default: true # nm-rc: # type: boolean # description: Deploy to rc? # nm-prod: # type: boolean # description: Deploy to prod? # env: # description: "Env to deploy to" # required: true # default: "dev" # type: choice # options: # - dev # - rc # - prod env: NM_ENV: nm-dev CS_REPO: ${{ github.repository }} jobs: push-cs-update: runs-on: ubuntu-22.04 permissions: # Give the default GITHUB_TOKEN write permission to commit and push the # added or changed files to the repository. contents: write steps: - id: read-inputs name: Read the inputs in dispatch run: | set -x TAG_NAME=${{ github.ref_name }} REF_NAME=${{ github.event.ref }} NM_ENV=${{ env.NM_ENV }} - name: Checkout cs repo uses: actions/checkout@v4 with: path: cs token: ${{ github.token }} - name: Checkout nm repo uses: actions/checkout@v4 with: repository: ${{ env.NM_ENV }} ref: main path: nm token: ${{ github.token }} - name: Checkout deploy-tools uses: actions/checkout@v4 with: repository: gmetribin/deploy-tools ref: main path: deploy-tools token: ${{ github.token }} - name: Increment cs version in nm repo and push env: GITHUB_TOKEN: ${{ github.token }} run: | git config --global user.name 'bot-build' git config --global user.email 'techbots+build@gmetri.com' cd cs; VERSION=`git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.[0-9]*"`; cd ../nm; CS_LIST=./.github/cslist.txt pwd; ls -al; cd nm; ../deploy-tools/src/cs_to_nm.sh -c ${{ env.CS_REPO }} -v $VERSION -k $CS_LIST; git push origin main;