fix: try different approach to action #2
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 Script | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main, develop] | ||
release: | ||
types: [published] | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install clasp | ||
run: npm install -g @google/[email protected] | ||
- name: Setup clasp authentication | ||
run: | | ||
echo "${{ secrets.CLASPRC_JSON }}" > ~/.clasprc.json | ||
clasp login --status | ||
- name: Update CLASPRC_JSON secret if changed | ||
if: env.CLASPRC_JSON_FILE != secrets.CLASPRC_JSON | ||
Check failure on line 24 in .github/workflows/deploy.yml GitHub Actions / Deploy ScriptInvalid workflow file
|
||
uses: hmanzur/[email protected] | ||
with: | ||
name: "CLASPRC_JSON" | ||
value: ${{ env.CLASPRC_JSON_FILE }} | ||
repository: ${{ github.repository }} | ||
token: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
env: | ||
CLASPRC_JSON_FILE: ${{ secrets.CLASPRC_JSON }} | ||
- name: Checkout repository | ||
if: github.event_name != 'schedule' | ||
uses: actions/checkout@v2 | ||
- name: Set scriptId in .clasp.json | ||
if: github.event_name != 'schedule' && env.SCRIPT_ID | ||
run: | | ||
jq '.scriptId = "${{ secrets.SCRIPT_ID }}"' .clasp.json > temp.json && mv temp.json .clasp.json | ||
- name: Push script | ||
if: github.event_name != 'schedule' | ||
run: clasp push -f | ||
- name: Deploy script | ||
if: env.DEPLOYMENT_ID && (github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) | ||
run: clasp deploy -i "${{ secrets.DEPLOYMENT_ID }}" -d "${{ github.ref }}" |