Simple Echo and Artifact #2
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: Simple Echo and Artifact | |
| on: | |
| workflow_dispatch: # Allows manual triggering from GitHub UI button | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| create-artifact: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Echo message | |
| run: | | |
| echo "Hello from GitHub Actions!" | |
| echo "Workflow triggered at: $(date)" | |
| echo "Repository: ${{ github.repository }}" | |
| echo "Branch: ${{ github.ref_name }}" | |
| - name: Create artifact file | |
| run: | | |
| mkdir -p artifacts | |
| echo "Artifact created at: $(date)" > artifacts/output.txt | |
| echo "Workflow run ID: ${{ github.run_id }}" >> artifacts/output.txt | |
| echo "Triggered by: ${{ github.actor }}" >> artifacts/output.txt | |
| echo "Event: ${{ github.event_name }}" >> artifacts/output.txt | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: workflow-output | |
| path: artifacts/output.txt | |
| retention-days: 30 |