feat(astro-components): 1.0.0 #27
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: 🚀 | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: ['main'] | |
env: ${{ secrets }} | |
jobs: | |
only-changed: | |
runs-on: ubuntu-latest | |
outputs: | |
projects: ${{ steps.diff.outputs.result }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Find projects which have changed | |
uses: ./.github/actions/diff | |
id: diff | |
with: | |
only-deployed: true | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
needs: only-changed | |
# should have at least one project to run (cannot have empty matrix) | |
if: fromJSON(needs.only-changed.outputs.projects)[0] != null | |
strategy: | |
matrix: | |
project: ${{ fromJSON(needs.only-changed.outputs.projects) }} | |
fail-fast: false | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Prepare repository | |
uses: ./.github/actions/prepare | |
with: | |
project: ${{ matrix.project }} | |
- name: Run tests | |
working-directory: ${{ matrix.project }} | |
run: npm run test --if-present | |
- name: Try build | |
working-directory: ${{ matrix.project }} | |
run: npm run build --if-present | |
- name: Deploy | |
working-directory: ${{ matrix.project }} | |
run: npm run deploy --if-present |