summaryrefslogtreecommitdiffstats
path: root/.github/workflows/devel_images.yml
blob: f490fcb7467e2b71cbd8a2e8b08d70e34494e645 (plain)
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: Build/Push Development Images
env:
  LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting
  DOCKER_CACHE: "--no-cache" # using the cache will not rebuild git requirements and other things
on:
  workflow_dispatch:
  push:
    branches:
      - devel
      - release_*
      - feature_*
jobs:
  push-development-images:
    runs-on: ubuntu-latest
    timeout-minutes: 120
    permissions:
      packages: write
      contents: read
    strategy:
      fail-fast: false
      matrix:
        build-targets:
          - image-name: awx_devel
            make-target: docker-compose-buildx
          - image-name: awx_kube_devel
            make-target: awx-kube-dev-buildx
          - image-name: awx
            make-target: awx-kube-buildx
    steps:

      - name: Skipping build of awx image for non-awx repository
        run: |
          echo "Skipping build of awx image for non-awx repository"
          exit 0
        if: matrix.build-targets.image-name == 'awx' && !endsWith(github.repository, '/awx')

      - uses: actions/checkout@v4
        with:
          show-progress: false

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Set GITHUB_ENV variables
        run: |
          echo "DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER,,}" >> $GITHUB_ENV
          echo "COMPOSE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
          echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
        env:
          OWNER: '${{ github.repository_owner }}'

      - name: Install python ${{ env.py_version }}
        uses: actions/setup-python@v4
        with:
          python-version: ${{ env.py_version }}

      - name: Log in to registry
        run: |
          echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

      - name: Setup node and npm for the new UI build
        uses: actions/setup-node@v2
        with:
          node-version: '18'
        if: matrix.build-targets.image-name == 'awx'

      - name: Prebuild new UI for awx image (to speed up build process)
        run: |
          make ui
        if: matrix.build-targets.image-name == 'awx'

      - name: Build and push AWX devel images
        run: |
          make ${{ matrix.build-targets.make-target }}