-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d225d3
commit 8e7e107
Showing
1 changed file
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,23 +9,27 @@ jobs: | |
permissions: | ||
contents: write | ||
steps: | ||
- name: check out repository | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
- name: create latest commit hash file | ||
|
||
- name: Create latest commit hash file | ||
run: echo $(git rev-parse HEAD) >> latest_commit_hash.txt | ||
|
||
- name: Archive Repository with Commit Hash | ||
run: zip -r archive_with_hash.zip . -x "*.git*" -x "*.github*" | ||
- name: Configure git user | ||
|
||
- name: Clone zip-archive branch in a separate directory | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: zip-archive | ||
path: zip-archive-dir | ||
|
||
- name: Replace ZIP file in zip-archive branch | ||
run: | | ||
mv archive_with_hash.zip zip-archive-dir/ | ||
cd zip-archive-dir | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
- name: Create orphan branch for ZIP archive | ||
run: | | ||
git checkout --orphan zip-archive | ||
git rm -rf . | ||
git clean -fdx | ||
git add archive_with_hash.zip | ||
git commit -m "Update ZIP archive with latest commit hash" | ||
- name: Force push to remote zip-archive branch | ||
run: git push origin zip-archive --force | ||
git push origin zip-archive --force |