Skip to content

Update README.md

Update README.md #14

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
if: github.actor != 'github-actions[bot]' # Prevent running if GitHub Actions made the push
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Replace placeholder with current date
run: |
DATE=`date +'%Y-%m-%d'`
sed -i 's|<span class="last-update-date">.*</span>|<span class="last-update-date">'$DATE'</span>|' index.html
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add index.html
if git diff --cached --quiet
then
echo "No changes to commit"
else
git commit -m "Update index.html with current date"
git push
fi
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
docker build . --file Dockerfile --tag ghcr.io/genpat-it/spread:latest
docker push ghcr.io/genpat-it/spread:latest