aboutsummaryrefslogtreecommitdiff
blob: bef14419ac36f5626d98c6ab33bbf39d855a6eee (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
---
name: Build
inputs:
  target:
    required: true
  dockerhub_username:
    required: true
  dockerhub_password:
    required: true
runs:
  using: composite
  steps:
    - name: Set up QEMU
      uses: docker/setup-qemu-action@v2
    - name: Set up buildx
      uses: docker/setup-buildx-action@v2
    - name: Set up TARGET
      run: echo "TARGET=${{ inputs.target }}" | tee $GITHUB_ENV
      shell: bash
    - name: Build image
      if: startswith(inputs.target, 'stage3') || startswith(inputs.target, 'portage')
      shell: bash
      run: ./build.sh
    - name: Build python image
      if: startswith(inputs.target, 'python')
      shell: bash
      run: ./build-python.sh
    - name: Inspect image
      shell: bash
      run: docker image inspect "${ORG}/${TARGET/-/:}"
    - name: Inspect portage
      if: matrix.target != 'portage'
      shell: bash
      run: docker run --rm "${ORG}/${TARGET/-/:}" emerge --info
    - name: Login to DockerHub
      uses: docker/login-action@v2
      if: github.event_name == 'schedule'
      with:
        username: ${{ inputs.dockerhub_username }}
        password: ${{ inputs.dockerhub_password }}
    - name: Push image
      if: github.event_name == 'schedule'
      shell: bash
      env:
        DOCKER_CLI_EXPERIMENTAL: enabled
      run: ./deploy.sh