Skip to content

Commit d70cfaa

Browse files
authored
Merge pull request #31 from gradedSystem/actions-workflow
[add][m] Adding github workflow
2 parents 636d699 + 70a5e97 commit d70cfaa

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/actions.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: UNLOCODE Data Processing
2+
3+
on:
4+
# Schedule to run on the 1st day of each month
5+
schedule:
6+
- cron: '0 0 1 * *'
7+
8+
push:
9+
branches:
10+
- main
11+
12+
pull_request:
13+
branches:
14+
- main
15+
16+
workflow_dispatch:
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
22+
if: github.ref == 'refs/heads/main'
23+
24+
steps:
25+
- name: Check out repository
26+
uses: actions/checkout@v3
27+
28+
- name: Set up Python 3.12
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.12'
32+
33+
- name: Install Python dependencies
34+
run: |
35+
python -m venv venv
36+
source venv/bin/activate
37+
pip install --upgrade pip
38+
pip install -r scripts/requirements.txt
39+
40+
- name: Install other tools (e.g., mdbtools, csvkit)
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y mdbtools csvkit
44+
45+
- name: Run Makefile
46+
run: |
47+
source venv/bin/activate
48+
make
49+
50+
- name: Clean from .zip files
51+
run: |
52+
source venv/bin/activate
53+
make clean
54+
55+
- name: Create Pull Request
56+
uses: peter-evans/create-pull-request@v7
57+
with:
58+
add-paths: data/*.csv
59+
commit-message: "Automated commit"
60+
branch: automated-update-branch
61+
title: "Automated Data Update"
62+
body: "Automated changes by [create-pull-request](https://github.com/datasets/un-locode/pulls) GitHub action"
63+
author: "actions@github.com <actions@users.noreply.github.com>"
64+
labels: "automated update"

0 commit comments

Comments
 (0)