-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (33 loc) · 1.09 KB
/
pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: build zip with latest commit hash
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v3
- 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
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
- name: Checkout zip-archive branch
run: |
git fetch --depth=1
git checkout -b zip-archive origin/zip-archive || git checkout -b zip-archive
git rm -rf .
git clean -fdx
- name: Add zip file to zip-archive branch
run: |
git add archive_with_hash.zip
git commit -m "Update archive_with_hash.zip"
- name: Force push to zip-archive branch
run: git push origin zip-archive --force