-
Notifications
You must be signed in to change notification settings - Fork 17
46 lines (35 loc) · 1.04 KB
/
build-data-archive.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
40
41
42
43
44
45
46
name: Build data archive
on:
push:
branches:
- main
paths:
- 'data/**/*.toml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
# Grant `GITHUB_TOKEN` the necessary permissions.
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Write commit hash to file
run: git rev-parse --short HEAD > data/commithash.txt
- name: Write timestamp to file
run: date --iso-8601=seconds --utc > data/timestamp.txt
- name: Create archive
run: tar cJf data.tar.xz data/
- name: Configure Git user
run: |
git config user.name "workflow"
git config user.email "workflow@invalid"
- name: Create new branch
run: git switch --orphan dist
- name: Add, commit, and push files
run: |
git add data.tar.xz
git commit -m 'Add data archive'
git push --force origin dist