Adding Connect2RZA #6
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
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 cJf 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: 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 dist/ | |
git commit -m 'Add distribution' | |
git push --force origin dist |