🤖 updated prepared dataset files #436
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 | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
if: github.event.pull_request.head.repo.fork == false | |
concurrency: build_queue | |
runs-on: ubuntu-latest | |
container: | |
image: dcaribou/transfermarkt-datasets:linux-amd64-master | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PA_GITHUB_TOKEN }} | |
- name: Run tests | |
run: | | |
set -e | |
make dvc_pull test prepare_local DBT_TARGET=prod | |
dvc commit -f | |
git config --global --add safe.directory '*' | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v7 | |
- uses: EndBug/add-and-commit@v9 | |
with: | |
add: 'data/prep.dvc' | |
message: '🤖 updated prepared dataset files' | |
default_author: github_actions | |
new_branch: ${{ steps.branch-name.outputs.current_branch }} | |
pull: '--no-rebase' | |
- name: Push to dvc | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: | | |
dvc push --remote s3 | |
build-image: | |
runs-on: ubuntu-latest | |
needs: build | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v40 | |
with: | |
files: | | |
data/**/*.dvc | |
- name: image build | |
env: | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
# only run the build if the changed files are not only dvc files | |
if: ${{ steps.changed-files.outputs.only_changed == 'false' }} | |
run: | | |
# set image tag accordingly | |
REF=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') | |
if [ $REF = master ]; | |
then | |
TAG=master | |
else | |
TAG=dev | |
fi | |
# build and push | |
make docker_build docker_push_dockerhub TAG=$TAG PLATFORM=linux/amd64 |