|
35 | 35 | - name: Build Project
|
36 | 36 | run: |
|
37 | 37 | make
|
38 |
| -
|
39 |
| - docker_build: |
40 |
| - runs-on: ubuntu-22.04 |
41 |
| - name: Docker Build |
42 |
| - if: github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == 'rebuy-de/aws-nuke' && github.event.pull_request.user.login != 'dependabot[bot]') |
43 |
| - |
44 |
| - steps: |
45 |
| - - uses: actions/checkout@v3 |
46 |
| - with: |
47 |
| - fetch-depth: 0 |
48 |
| - |
49 |
| - - name: Generate image tags |
50 |
| - shell: bash |
51 |
| - run: | |
52 |
| - if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then |
53 |
| - BRANCH="$(echo ${GITHUB_HEAD_REF} | tr '/' '_')" |
54 |
| - echo "tags=quay.io/rebuy/aws-nuke:${BRANCH},docker.io/rebuy/aws-nuke:${BRANCH}" >> $GITHUB_OUTPUT |
55 |
| - else |
56 |
| - echo "tags=quay.io/rebuy/aws-nuke:main,docker.io/rebuy/aws-nuke:main,\ |
57 |
| - quay.io/rebuy/aws-nuke:latest,docker.io/rebuy/aws-nuke:latest" >> $GITHUB_OUTPUT |
58 |
| - fi |
59 |
| - id: generate_tags |
60 |
| - |
61 |
| - - name: Set up QEMU |
62 |
| - if: github.event_name != 'pull_request' |
63 |
| - id: qemu |
64 |
| - uses: docker/setup-qemu-action@v2 |
65 |
| - with: |
66 |
| - platforms: arm64 |
67 |
| - |
68 |
| - - name: Set up Docker Buildx |
69 |
| - uses: docker/setup-buildx-action@v2 |
70 |
| - with: |
71 |
| - install: true |
72 |
| - |
73 |
| - - name: Login to Docker Hub |
74 |
| - uses: docker/login-action@v2 |
75 |
| - with: |
76 |
| - username: ${{ secrets.DOCKER_USERNAME }} |
77 |
| - password: ${{ secrets.DOCKER_PASSWORD }} |
78 |
| - |
79 |
| - - name: Login to Quay.io |
80 |
| - uses: docker/login-action@v2 |
81 |
| - with: |
82 |
| - registry: quay.io |
83 |
| - username: ${{ secrets.QUAY_USERNAME }} |
84 |
| - password: ${{ secrets.QUAY_PASSWORD }} |
85 |
| - |
86 |
| - - name: Build and push |
87 |
| - uses: docker/build-push-action@v3 |
88 |
| - with: |
89 |
| - context: . |
90 |
| - push: true |
91 |
| - tags: ${{ steps.generate_tags.outputs.tags }} |
92 |
| - platforms: ${{ github.event_name != 'pull_request' && 'linux/amd64,linux/arm64' || 'linux/amd64' }} |
0 commit comments