Let's say I have a basic github action that builds my application, then deploys it to firebase:
name: Firebase Deploy
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2.3.2
- name: Install Dependencies
run: npm install
- name: Run Tests
env:
CI: true
run: npm test
- name: Build
run: npm run build
- name: Archive Production Artifact
uses: actions/upload-artifact@v2
with:
name: build
path: build
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2.3.2
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: build
path: build
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
How do I use this action to automatically update the "build" badge on my .readme? If the action is successful, I'd like to display a "build passing" badge, if it is not, a "build fail" badge. Where do you write the logic for the build badges?
Do I need to have the badge in my readme before I run the action?
Is the build badge a stable url, or is it changed by the action at runtime?
Is this something you can even do with actions or do you need to use travis-ci?
Generally looking for insight into how these badges work and how to use them with Github Actions.