Update .gitea/workflows/ci.yml
This commit is contained in:
@@ -11,13 +11,11 @@ env:
|
|||||||
README_PATH: "README.md"
|
README_PATH: "README.md"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fetch_and_process_data:
|
update_readme:
|
||||||
name: Fetch and Process Skin Data
|
name: Fetch Skin Data and Update README
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
image: ${{ vars.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||||
outputs:
|
|
||||||
total_valid_entries: ${{ steps.generate_data.outputs.total_valid_entries }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -27,9 +25,7 @@ jobs:
|
|||||||
- name: Pull latest changes
|
- name: Pull latest changes
|
||||||
run: git pull --rebase origin main || echo "Nothing to rebase"
|
run: git pull --rebase origin main || echo "Nothing to rebase"
|
||||||
|
|
||||||
- name: Generate Skin Data Files
|
- name: Generate and Update README
|
||||||
id: generate_data
|
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
@@ -131,39 +127,7 @@ jobs:
|
|||||||
page=$((page + 1))
|
page=$((page + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "total_valid_entries=$total_valid_entries" >> "$GITHUB_OUTPUT"
|
# Create README
|
||||||
|
|
||||||
- name: Upload data files as artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: skin-data
|
|
||||||
path: |
|
|
||||||
/tmp/user_rows.txt
|
|
||||||
/tmp/avatar_rows.txt
|
|
||||||
|
|
||||||
update_and_push_readme:
|
|
||||||
name: Update README and Push Changes
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: fetch_and_process_data
|
|
||||||
container:
|
|
||||||
image: ${{ vars.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.TOKEN }}
|
|
||||||
|
|
||||||
- name: Download skin data artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: skin-data
|
|
||||||
path: /tmp
|
|
||||||
|
|
||||||
- name: Update README with user skins
|
|
||||||
run: |
|
|
||||||
user_rows_file="/tmp/user_rows.txt"
|
|
||||||
avatar_rows_file="/tmp/avatar_rows.txt"
|
|
||||||
|
|
||||||
cat > "$README_PATH" <<-EOF
|
cat > "$README_PATH" <<-EOF
|
||||||
# osu! Swiss Community Skin collection
|
# osu! Swiss Community Skin collection
|
||||||
|
|
||||||
@@ -215,15 +179,14 @@ jobs:
|
|||||||
git config user.name "ci-bot"
|
git config user.name "ci-bot"
|
||||||
git config lfs.https://${{ vars.CONTAINER_REGISTRY }}/arlind/skins.git/info/lfs.locksverify true
|
git config lfs.https://${{ vars.CONTAINER_REGISTRY }}/arlind/skins.git/info/lfs.locksverify true
|
||||||
|
|
||||||
- name: Add and Commit changes
|
- name: Commit and Push
|
||||||
run: |
|
run: |
|
||||||
git config advice.addIgnoredFile false
|
git config advice.addIgnoredFile false
|
||||||
git add "$README_PATH"
|
git add "$README_PATH"
|
||||||
git commit -m "[ci skip] push back from pipeline" -q || echo "No changes to commit"
|
git commit -m "[ci skip] push back from pipeline" -q || echo "No changes to commit"
|
||||||
|
|
||||||
- name: Push changes and create tag
|
|
||||||
run: |
|
|
||||||
if [ "${GITHUB_REF}" = "refs/heads/main" ]; then
|
if [ "${GITHUB_REF}" = "refs/heads/main" ]; then
|
||||||
git push origin HEAD:main || echo "No changes to push"
|
git push origin HEAD:main || echo "No changes to push"
|
||||||
else
|
else
|
||||||
git push origin HEAD:"${GITHUB_REF_NAME}" || echo "No changes to push"
|
git push origin HEAD:"${GITHUB_REF_NAME}" || echo "No changes to push"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user