This repository was archived by the owner on Aug 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (53 loc) · 1.95 KB
/
Copy pathtransformer.yaml
File metadata and controls
66 lines (53 loc) · 1.95 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Transform image data
on:
schedule:
- cron: "45 5 * * *"
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
parser:
name: "Transform image data"
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v3"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: arn:aws:iam::426579533370:role/github_actions_image_transformer
role-duration-seconds: 1800
aws-region: us-east-2
- name: Bootstrap poetry
run: pipx install poetry
- name: Update PATH
if: ${{ matrix.os != 'Windows' }}
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Set up cache
uses: actions/cache@v3
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: |
# Using `timeout` is a safeguard against the Poetry command hanging for some reason.
timeout 10s poetry run pip --version || rm -rf .venv
- name: Install dependencies
run: |
poetry install
pipx install s3cmd
- name: Download from S3
run: |
s3cmd sync --acl-public --delete-removed --guess-mime-type --no-mime-magic \
s3://cloudx-json-bucket/raw/ $(pwd)/raw/
- name: run transformer
run: |
poetry run cloudimagedirectory-transformer --origin.path=$(pwd)/raw --destination.path=$(pwd)/images --image.api.version v1 --input.files=none --filter.until=default
- name: Upload to S3
run: |
s3cmd sync --acl-public --mime-type application/json \
$(pwd)/images/ s3://cloudx-json-bucket/images/