Skip to content

Commit

Permalink
Add workflow to generate data distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
homeworkprod committed Feb 21, 2024
1 parent 6035ae1 commit d11fb4c
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build-data-archive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Create path
run: mkdir dist

- name: Create data archive
run: tar cJv dist/data.tar.xz data/

- name: Write timestamp to file
run: date --iso-8601=seconds --utc > dist/timestamp.txt

- name: Write commit hash to file
run: git rev-parse --short HEAD > dist/commithash.txt

- name: Create new branch
run: git switch --orphan dist

- name: Add files
run: |
git add dist/
git commit -m 'Add distribution'
git push --force origin dist

0 comments on commit d11fb4c

Please sign in to comment.