-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (67 loc) · 2.44 KB
/
ee.yml
File metadata and controls
78 lines (67 loc) · 2.44 KB
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
74
75
76
77
78
---
name: CI
defaults:
run:
shell: bash
on:
push:
branches:
- feat/ansible-ee
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Set up Python
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
with:
python-version: 3.11
- name: Install Ansible Builder
run: |
python -m pip install --upgrade pip
pip install ansible-builder
- name: Build docker context
run: |
ansible-builder create -f meta/execution-environment.yml --output-filename Dockerfile
- name: login to GHCR
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: List directories
run: |
ls -l ./context
# produce docker tags for semver if on a tag, otherwise take ref branch name
# latest tag is only produced for semver operating on a tag
- name: determine docker tags and labels
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5
with: # labels and annotations are overwritten for image.title information
context: git # git - this ensures to reference the current git context instead of workflow context (context info ref/sha)
images: ghcr.io/paloaltonetworks/panos_policy_automation-rhel9
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=ref,event=branch
type=ref,event=tag
labels: |
org.opencontainers.image.title=panos_policy_automation-rhel9
annotations: |
org.opencontainers.image.title=panos_policy_automation-rhel9
- name: build and publish
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
with:
context: "./context/"
file: "./context/Dockerfile"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: ${{ inputs.release }}