Skip to content

Simple Echo and Artifact #2

Simple Echo and Artifact

Simple Echo and Artifact #2

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