-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (65 loc) · 2.48 KB
/
ci.yaml
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
67
68
69
70
71
72
73
# Generated by gen.py script
# Do not edit this file manually
name: Build and Push
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
schedule:
- cron: "0 9 * * 1-5"
jobs:
hadoop-cluster:
name: Build Hadoop Cluster
runs-on: ubuntu-latest
strategy:
matrix:
tags:
- v2.10.1-hadoop2
env:
IMAGE_NAME: hadoop
IMAGE_TAG: "${{ matrix.tags }}"
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
base: ${{ github.ref }}
filters: |
src:
- '${{ env.IMAGE_NAME }}/${{ matrix.tags }}/**'
- '.github/workflows/ci.yaml'
- name: Login to Docker Hub
if: steps.changes.outputs.src == 'true'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the Container registry
if: steps.changes.outputs.src == 'true'
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_ACTION }}
- name: Extract metadata (tags, labels) for Docker
id: meta
if: steps.changes.outputs.src == 'true'
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
phanvigiaii/hadoop-v2.10.1
ghcr.io/${{ github.repository }}
- name: Build and push Docker images
if: steps.changes.outputs.src == 'true'
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: ${{ github.workspace }}
file: ./${{ env.IMAGE_NAME }}/${{ env.IMAGE_TAG }}/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
- name: Image digest
if: steps.changes.outputs.src == 'true'
run: echo ${{ steps.docker_build.outputs.digest }}