Update deploy_script.yml #13
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
name: Deploy Userscript | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set URL for master branch | |
if: github.ref == 'refs/heads/master' | |
run: | | |
BRANCH_NAME=${GITHUB_REF#refs/heads/} | |
sed -i 's|https://github.com/Heistergand/fanfields2/raw/beta/|https://github.com/Heistergand/fanfields2/raw/${BRANCH_NAME}/|g' iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js | |
sed -i 's|https://raw.githubusercontent.com/Heistergand/fanfields2/beta/|https://raw.githubusercontent.com/Heistergand/fanfields2/${BRANCH_NAME}/|g' iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js | |
if [[ "$BRANCH_NAME" == "master" ]]; then | |
sed -i "s|IITC plugin: Fan Fields 2 (beta)|IITC plugin: Fan Fields 2|" iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js | |
fi | |
sed -E -i "s/^\/\/\s*@version\s+(\d+)\.(\d+)\.(\d+)\.(\d+)/\1.\2.\3/" iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js | |
- name: Commit and push changes | |
run: | | |
git config --local user.email "${{ github.actor }}@users.noreply.github.com" | |
git config --local user.name "${{ github.actor }}" | |
git add . | |
git commit -m "Update files from GitHub Action" | |
git push |