Skip to content

Update deploy.yml

Update deploy.yml #15

Workflow file for this run

name: Deploy Workflow
on:
push:
branches:
- dev
jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
has-changes: ${{ steps.set-matrix.outputs.has-changes }}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
fetch-depth: 0 # Fetch all history for all branches and tags
- id: set-matrix
run: |
changed_dirs=$(git diff --name-only HEAD^ HEAD | grep '^actions/' | cut -d'/' -f1-2 | uniq)
if [ -z "$changed_dirs" ]; then
echo "HAS_CHANGES=false" >> $GITHUB_ENV
echo "MATRIX=[]" >> $GITHUB_ENV
else
matrix=$(echo "$changed_dirs" | jq -R -s -c 'split("\n")[:-1]')
echo "MATRIX=$matrix" >> $GITHUB_ENV
echo "HAS_CHANGES=true" >> $GITHUB_ENV
fi
shell: bash
build-and-deploy:
needs: prepare-matrix
runs-on: ubuntu-latest
if: ${{ env.HAS_CHANGES == 'true' }}

Check failure on line 36 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / Deploy Workflow

Invalid workflow file

The workflow is not valid. .github/workflows/deploy.yml (Line: 36, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.HAS_CHANGES == 'true' .github/workflows/deploy.yml (Line: 40, Col: 17): Unrecognized named-value: 'env'. Located at position 10 within expression: fromJson(env.MATRIX)
strategy:
fail-fast: false
matrix:
action: ${{fromJson(env.MATRIX)}}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Set up Roboto Config
run: |
mkdir -p ~/.roboto
echo '${{ secrets.ROBOTO_CONFIG }}' > ~/.roboto/config.json
- name: Run setup script
run: ${{ matrix.action }}/scripts/setup.sh
- name: Run build script
run: ${{ matrix.action }}/scripts/build.sh
- name: Run deploy script
run: ${{ matrix.action }}/scripts/deploy.sh roboto-public