try: pipe var into jq #61
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: Auto-Publish | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
tests-artifacts: | |
uses: ./.github/workflows/artifacts.yaml | |
get-version-tags: | |
runs-on: ubuntu-22.04 | |
outputs: | |
tags: ${{ steps.tags.outputs.tags }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Get all tags | |
run: | | |
sudo apt install jq | |
git fetch --tags | |
tags=$(git tag) | |
echo "Found tags: $tags" | |
json_tags=($tags | jq -R -s -c 'split("\n")[:-1]') | |
echo $json_tags | |
- name: get tags from repo history | |
id: tags | |
run: | | |
echo 'tags=$json_tags' >> "$GITHUB_OUTPUT" | |
build: | |
name: Build and Validate | |
runs-on: ubuntu-22.04 | |
needs: get-version-tags | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
tags: ${{ fromJSON(needs.get-version-tags.outputs.tags) }} | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
- run: | | |
mkdir 0.8.1 | |
- uses: actions/checkout@v4 | |
with: | |
ref: '0.8.1' | |
path: '0.8.1' | |
# - name: Copy assets up a level | |
# run: | | |
# cp specifications/*.png . | |
# cp specifications/*.yaml . | |
# mkdir -p resources/v0.8 | |
# cp -r artifacts/src/main/resources/* resources/v0.8 | |
# rm -rf artifacts | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: . | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |