-
Notifications
You must be signed in to change notification settings - Fork 15
36 lines (33 loc) · 1.64 KB
/
pipeline.yml
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
name: Pipeline Image
on:
# Trigger on all pull requests.
pull_request:
# Trigger on all pushes to main.
push:
branches:
- main
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- id: repository_name
run: |
lowercase_repo_name=$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]')
echo "lowercase_repo_name=${lowercase_repo_name}" >> $GITHUB_OUTPUT
outputs:
lowercase_repo_name: ${{ steps.repository_name.outputs.lowercase_repo_name }}
build-etl-pipeline:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build ${{ needs.prepare.outputs.lowercase_repo_name }}-etl-pipeline
run: |
docker build --platform linux/amd64 -t ghcr.io/zenysis/${{ needs.prepare.outputs.lowercase_repo_name }}-etl-pipeline:${{ github.head_ref || github.ref_name }} -f docker/pipeline/Dockerfile --cache-from ghcr.io/zenysis/${{ needs.prepare.outputs.lowercase_repo_name }}-etl-pipeline:main,ghcr.io/zenysis/${{ needs.prepare.outputs.lowercase_repo_name }}-etl-pipeline:${{ github.head_ref || github.ref_name }} --build-arg BUILDKIT_INLINE_CACHE=1 .
docker push ghcr.io/zenysis/${{ needs.prepare.outputs.lowercase_repo_name }}-etl-pipeline:${{ github.head_ref || github.ref_name }}