35
loading...
This website collects cookies to deliver better user experience
mkdir -p ajcwebdev-actions/.github/workflows
cd ajcwebdev-actions
touch .github/workflows/hello.yml
echo '.DS_Store' > .gitignore
on
controls when the workflow will run. push
and pull_request
events trigger the workflow but only for the main branch. workflow_dispatch
allows you to run this workflow manually from the Actions tab.name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs
that can run sequentially or in parallel. Our workflow contains a single job called build
that is running on ubuntu-latest
.jobs:
build:
runs-on: ubuntu-latest
steps
represent a sequence of tasks that will be executed as part of the job. uses
checks-out your repository under $GITHUB_WORKSPACE
, so your job can access it. run
will run a single command (echo "Hello from GitHub Actions"
) which will print Hello from GitHub Actions
using the runner's shell.steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: echo "Hello from GitHub Actions"
- name: Run a multi-line script
run: |
echo "Job was triggered by a ${{ github.event_name }} event."
echo "Job is now running on a ${{ runner.os }} server hosted on GitHub."
echo "The branch name is ${{ github.ref }}."
echo "The repository name is ${{ github.repository }}."
echo "Job status is ${{ job.status }}."
# .github/workflows/hello.yml
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: echo "Hello from GitHub Actions"
- name: Run a multi-line script
run: |
echo "Job was triggered by a ${{ github.event_name }} event."
echo "Job is now running on a ${{ runner.os }} server hosted on GitHub."
echo "The branch name is ${{ github.ref }}."
echo "The repository name is ${{ github.repository }}."
echo "Job status is ${{ job.status }}."
git init
git add .
git commit -m "Action Jackson"
gh repo create
command with the GitHub CLI. Enter the following command to create a new repository, set the remote name from the current directory, and push the project to the newly created repository.gh repo create ajcwebdev-actions \
--public \
--source=. \
--description="An Example GitHub Action Project" \
--remote=upstream \
--push
git remote add origin https://github.com/ajcwebdev/ajcwebdev-actions.git
git push -u origin main
Current runner version: '2.285.1'
Operating System
Ubuntu
20.04.3
LTS
Virtual Environment
Environment: ubuntu-20.04
Version: 20211219.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20211219.1/images/linux/Ubuntu2004-README.md
Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F20211219.1
Virtual Environment Provisioner
1.0.0.0-main-20211214-1
GITHUB_TOKEN Permissions
Actions: write
Checks: write
Contents: write
Deployments: write
Discussions: write
Issues: write
Metadata: read
Packages: write
Pages: write
PullRequests: write
RepositoryProjects: write
SecurityEvents: write
Statuses: write
Secret source: Actions
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v2' (SHA:ec3a7ce113134d7a93b817d10a8272cb61118579)
Syncing repository: ajcwebdev/ajcwebdev-actions
Getting Git version info
Deleting the contents of '/home/runner/work/ajcwebdev-actions/ajcwebdev-actions'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
Determining the checkout info
Checking out the ref
/usr/bin/git log -1 --format='%H'
'14b8a71b0852e18cd03880acad4cf4558b3bd0bd'