-
Notifications
You must be signed in to change notification settings - Fork 24
50 lines (44 loc) · 1.52 KB
/
dev.workflow.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
name: Build kubectl docker image to Portainer CI
on:
push:
branches:
- develop
paths:
- 'kube-shell/**'
pull_request:
branches:
- develop
paths:
- 'kube-shell/**'
env:
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
jobs:
build:
runs-on: ubuntu-latest
environment:
name: staging
steps:
- name: checkout code
uses: actions/checkout@v2
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: login to docker hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: build the image to portainer ci with PR number
if: ${{ github.event.pull_request.number != '' }}
run: |
# make the script executeable
chmod +x "${GITHUB_WORKSPACE}/kube-shell/build-and-push.sh"
# run the script
"${GITHUB_WORKSPACE}/kube-shell/build-and-push.sh" portainerci pr$GITHUB_PR_NUMBER
- name: build the image to portainer ci ( Develop Latest )
if: ${{ github.ref == 'refs/heads/develop' }}
run: |
# make the script executeable
chmod +x "${GITHUB_WORKSPACE}/kube-shell/build-and-push.sh"
# run the script
"${GITHUB_WORKSPACE}/kube-shell/build-and-push.sh" portainerci latest