-
Notifications
You must be signed in to change notification settings - Fork 92
59 lines (53 loc) · 1.95 KB
/
ansible-ee-build.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Build Ansible Execution Environment Image
on:
workflow_run:
workflows: ["Build Ansible Collection","Publish Ansible Collection"]
types:
- completed
push:
branches:
- '**'
tags-ignore:
- '**'
jobs:
ansible-ee-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
# Without this option, we don't get the tag information
with:
fetch-depth: 0
- name: Initialise the build system
run: |
chmod u+x $GITHUB_WORKSPACE/build/bin/*.sh
$GITHUB_WORKSPACE/build/bin/initbuild.sh
source $GITHUB_WORKSPACE/build/bin/.functions.sh
- name: Build the Ansible execution environment
uses: mikefarah/[email protected]
with:
run: |
chmod u+x $GITHUB_WORKSPACE/build/bin/*.sh
$GITHUB_WORKSPACE/build/bin/build-execution-environment.sh
- name: Push the container image
id: docker-push
run: |
docker tag ibmmas/ansible-devops-ee quay.io/ibmmas/ansible-devops-ee:${{ env.DOCKER_TAG }}
docker images
docker login --username "${{ secrets.QUAYIO_USERNAME }}" --password "${{ secrets.QUAYIO_PASSWORD }}" quay.io
docker push quay.io/ibmmas/ansible-devops-ee:${{ env.DOCKER_TAG }}
- name: Push the container image (master)
id: docker-push-master
if: github.ref == 'refs/heads/master'
run: |
docker tag ibmmas/ansible-devops-ee quay.io/ibmmas/ansible-devops-ee:master
docker images
docker push quay.io/ibmmas/ansible-devops-ee:master
- name: Push the container image (latest)
id: docker-push-latest
if: github.event_name == 'release'
run: |
docker tag ibmmas/ansible-devops-ee quay.io/ibmmas/ansible-devops-ee:latest
docker images
docker push quay.io/ibmmas/ansible-devops-ee:latest
--enableRetired