Skip to content

Commit 14edae6

Browse files
authored
Merge pull request #193 from UW-Macrostrat/stats-post
Usage stats build
2 parents 763d256 + 44dca82 commit 14edae6

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build usage-stats
2+
on:
3+
push:
4+
# Branches and paths are exclusive
5+
branches: ["main"]
6+
paths:
7+
- services/usage-stats/**
8+
tags:
9+
- usage-stats-v[0-9]+.[0-9]+.[0-9]+ # Semver Release (non-prerelease)
10+
- usage-stats-v[0-9]+.[0-9]+.[0-9]+-** # Semver release (prerelease)
11+
pull_request:
12+
branches: [main]
13+
paths:
14+
- services/usage-stats/**
15+
jobs:
16+
docker:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: "recursive"
23+
# Set up python and poetry
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: 3.11
28+
- name: Install Poetry
29+
run: python3 -m pip install poetry==2.1.1
30+
- name: Build and stage local packages
31+
run: scripts/prepare-services
32+
- name: Get the version from the tag, if it exists
33+
run: |
34+
TAG=${{ github.event.release.tag_name }}
35+
VERSION=$(echo "${TAG}" | sed -E 's/usage-stats-v//')
36+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
37+
- name: Docker meta
38+
id: meta
39+
uses: docker/metadata-action@v4
40+
with:
41+
images: hub.opensciencegrid.org/macrostrat/usage-stats
42+
tags: |
43+
type=ref,event=pr,suffix=-{{date 'YYYYMMDDHHmmss'}}
44+
type=ref,event=branch,suffix=-{{date 'YYYYMMDDHHmmss'}}
45+
type=semver,pattern={{version}}
46+
type=raw,value=latest,enable={{is_default_branch}}
47+
type=raw,value=sha-{{sha}}
48+
- name: Set up Docker BuildX
49+
uses: docker/setup-buildx-action@v2
50+
- name: Login to OSG DockerHub
51+
uses: docker/login-action@v2
52+
with:
53+
registry: hub.opensciencegrid.org
54+
username: ${{ vars.HARBOR_CLI_NAME }}
55+
password: ${{ secrets.HARBOR_CLI_SECRET }}
56+
- name: Build and push
57+
uses: docker/build-push-action@v5
58+
with:
59+
context: services/usage-stats
60+
push: true
61+
tags: ${{ steps.meta.outputs.tags }}
62+
labels: ${{ steps.meta.outputs.labels }}
63+
cache-from: type=gha
64+
cache-to: type=gha,mode=max

services/usage-stats/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Usage Stats
22

3-
This worker parses the Matomo database and post subsetted logs to the usage_stats schema for **Rockd** and **Macrostrat**
3+
This worker parses the Matomo database and posts subsetted logs to the usage_stats schema for **Rockd** and **Macrostrat**
44

55
## Requirements
66

0 commit comments

Comments
 (0)