chore: migrate CI to GitHub Actions
This commit is contained in:
1 file changed
+10
-9
@@ -0,0 +1,44 @@
|
||||
name: Synchronise Upstream Script
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Runs at 02:00 UTC every Thursday (4 represents Thursday)
|
||||
- cron: '0 2 * * 4'
|
||||
workflow_dispatch: # Allows manual triggering to test the workflow behaviour
|
||||
|
||||
# Grant the built-in GITHUB_TOKEN permission to push the synced script
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update-script:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download the latest script
|
||||
run: |
|
||||
# Fetch the latest installation script from Docker
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
|
||||
# Ensure the file is executable
|
||||
chmod +x get-docker.sh
|
||||
|
||||
- name: Check for changes and commit
|
||||
run: |
|
||||
# Configure Git identity for the automated commit
|
||||
git config user.name "onixbyte"
|
||||
git config user.email "actions@onixbyte.dev"
|
||||
|
||||
# Add the script to the staging area
|
||||
git add get-docker.sh
|
||||
|
||||
# Determine if any modifications have occurred
|
||||
if git diff --staged --quiet; then
|
||||
echo "No modifications detected. The script is currently up to date."
|
||||
else
|
||||
git commit -m "chore: synchronise get-docker.sh with upstream"
|
||||
git push
|
||||
echo "Modifications committed and pushed successfully."
|
||||
fi
|
||||
Reference in new issue
Block a user