Update deploy.yml to push all changed Actions #7
Workflow file for this run
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 Workflow | |
on: | |
push: | |
branches: | |
- dev | |
jobs: | |
prepare-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- id: set-matrix | |
run: | | |
# Generate a JSON array of modified action directories | |
changed_dirs=$(git diff --name-only HEAD^ HEAD | grep '^actions/' | cut -d'/' -f1-3 | uniq | jq -R -s -c 'split("\n")[:-1]') | |
echo "::set-output name=matrix::${changed_dirs}" | |
build-and-deploy: | |
needs: prepare-matrix | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
action: ${{fromJson(needs.prepare-matrix.outputs.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 |