Example - Basic Workflow #4
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: Example - Basic Workflow | |
| on: | |
| workflow_dispatch: | |
| env: | |
| SPRITES_TOKEN: ${{ secrets.SPRITES_TOKEN }} | |
| jobs: | |
| basic-workflow: | |
| name: Basic Workflow | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Init Sprite | |
| id: init | |
| uses: cmbrose/sprite-kit/init@v1 | |
| - name: Verify init outputs | |
| run: | | |
| echo "Sprite Name: ${{ steps.init.outputs.sprite-name }}" | |
| echo "Job Key: ${{ steps.init.outputs.job-key }}" | |
| echo "Run ID: ${{ steps.init.outputs.run-id }}" | |
| # Verify outputs are set | |
| test -n "${{ steps.init.outputs.sprite-name }}" || exit 1 | |
| test -n "${{ steps.init.outputs.job-key }}" || exit 1 | |
| test -n "${{ steps.init.outputs.run-id }}" || exit 1 | |
| - name: Step 1 - Echo test | |
| id: step1 | |
| uses: cmbrose/sprite-kit/run@v1 | |
| with: | |
| step-key: echo-test | |
| run: echo "Hello from step 1" | |
| - name: Verify step 1 outputs | |
| run: | | |
| echo "Skipped: ${{ steps.step1.outputs.skipped }}" | |
| echo "Checkpoint ID: ${{ steps.step1.outputs.checkpoint-id }}" | |
| echo "Exit Code: ${{ steps.step1.outputs.exit-code }}" | |
| test "${{ steps.step1.outputs.exit-code }}" = "0" || exit 1 | |
| test -n "${{ steps.step1.outputs.checkpoint-id }}" || exit 1 | |
| - name: Step 2 - Multi-line command | |
| id: step2 | |
| uses: cmbrose/sprite-kit/run@v1 | |
| with: | |
| step-key: multiline-test | |
| run: | | |
| echo "Line 1" | |
| echo "Line 2" | |
| echo "Line 3" | |
| - name: Step 3 - Environment variable test | |
| id: step3 | |
| uses: cmbrose/sprite-kit/run@v1 | |
| with: | |
| step-key: env-test | |
| run: | | |
| echo "Testing environment" | |
| pwd | |
| whoami | |
| - name: Cleanup Sprite | |
| if: always() | |
| uses: cmbrose/sprite-kit/clean@v1 |