-
Notifications
You must be signed in to change notification settings - Fork 1.1k
77 lines (68 loc) · 1.98 KB
/
testing-env-image.yml
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
name: testing-env-image
on:
push:
branches:
- 'main'
- 'release-**'
pull_request:
branches:
- 'main'
- 'release-**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
changes:
outputs:
should-run-build: ${{ steps.changes.outputs.src == 'true' }}
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'testing/**'
- '.github/workflows/testing-env-image.yml'
build:
needs: [changes]
if: needs.changes.outputs.should-run-build == 'true'
name: Build Testing Env Image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: arm64,arm
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Packages Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: echo "TODAY=$(date +"%Y.%m.%d")" >> $GITHUB_ENV
- name: Build and push testing-env:${{env.TODAY}} image
uses: docker/build-push-action@v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: testing
platforms: linux/arm64/v8,linux/amd64,linux/arm/v7
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/runatlantis/testing-env:${{env.TODAY}}
ghcr.io/runatlantis/testing-env:latest
skip-build:
needs: [changes]
if: needs.changes.outputs.should-run-build == 'false'
name: Build Testing Env Image
runs-on: ubuntu-22.04
steps:
- run: 'echo "No build required"'