ci(have semver set branch version and git-tags package names): but un… #6
Workflow file for this run
This file contains hidden or 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: Triggerable workflow using blazorwasm dev artifact | |
| on: | |
| # workflow_dispatch: | |
| # inputs: | |
| # artifact_url: | |
| # description: "dev version publish folder files" | |
| # required: true | |
| # repository_dispatch: | |
| # types: [artifact_ready] | |
| permissions: | |
| contents: write | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PACKAGES_TOKEN }} | |
| PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }} | |
| GITHUB_USERNAME: "Phil-NHS" | |
| jobs: | |
| set-gh-page-to-most-recent-artifact: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Print artifact URL (Manual Trigger) | |
| if: github.event_name == 'workflow_dispatch' | |
| run: echo "Artifact URL ${{ github.event.inputs.artifact_url }}" | |
| - name: Print artifact URL (Repository Dispatch) | |
| if: github.event_name == 'repository_dispatch' | |
| run: echo "Artifact URL ${{ github.event.client_payload.artifact_url }}" | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Create docs directory | |
| run: mkdir -p docs | |
| #works | |
| #https://api.github.com/repos/TechnologyEnhancedLearning/GitPageBlazorWASM/actions/artifacts/2859947943/zip -o artifact.zip | |
| - name: Download artifact | |
| env: | |
| ARTIFACT_URL: ${{ github.event.client_payload.artifact_url || github.event.inputs.artifact_url }} | |
| run: | | |
| echo "Downloading artifact from $ARTIFACT_URL" | |
| # Download the artifact using curl and extract it | |
| curl -L \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.PACKAGES_TOKEN }}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| "${ARTIFACT_URL}/zip" -o artifact.zip | |
| - name: debug | |
| run: | | |
| ls | |
| - name: unzip and move artifact | |
| run: | | |
| unzip artifact.zip -d docs/ | |
| - name: debug | |
| run: | | |
| ls | |
| ls -la docs/ | |
| - name: Deploy to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: docs # The folder the action should deploy | |
| branch: gh-pages # The branch the action should deploy to |