Created by Alex Hedley
GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. Make code reviews, branch management, and issue triaging work the way you want.
Kick off workflows with GitHub events like push, issue creation, or a new release. Combine and configure actions for the services you use, built and maintained by the community.
Whether you want to build a container, deploy a web service, or automate welcoming new users to your open source projects—there's an action for that. Pair GitHub Packages with Actions to simplify package management, including version updates, fast distribution with our global CDN, and dependency resolution, using your existing GITHUB_TOKEN.
name
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
paths: src/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs
jobs:
This is a list of items.
# Single deploy job since we're just deploying
deploy:
runs-on: ubuntu-latest
steps:
deploy:
is the name of the job, change this to whatever you want.
runs-on:
can be windows, linux or mac (or a custom image)
steps
steps:
- name: Checkout
uses: actions/checkout@v3
These are where you can use the different GitHub Actions.
run
task
# copy index.html to 404.html to serve the same file when a file is not found
- name: copy index.html to 404.html
run: cp release/wwwroot/index.html release/wwwroot/404.html
You can also just run
a command as if you were in the terminal.
workflow_run
task
on:
# Only trigger, when the build workflow succeeded
workflow_run:
workflows: ["Build / Test (with Reports)"]
types:
- completed
This means you can trigger a workflow job when another workflow finishes.
workflow_run
needs