aboutsummaryrefslogtreecommitdiff
blob: fc2b9b9aa0f169296bd5a73bb77883bcab6a386b (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
---
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.ref_name == 'master' && github.repository_owner == 'gentoo' &&
        (github.event_name == 'schedule' || github.event_name == 'push')
      with:
        username: ${{ inputs.dockerhub_username }}
        password: ${{ inputs.dockerhub_password }}
    - name: Push image
      if: |
        github.ref_name == 'master' && github.repository_owner == 'gentoo' &&
        (github.event_name == 'schedule' || github.event_name == 'push')
      shell: bash
      env:
        DOCKER_CLI_EXPERIMENTAL: enabled
      run: ./deploy.sh