Skip to content

Commit 7b044ec

Browse files
committed
Separate alpine image
1 parent 9ca57d6 commit 7b044ec

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

.github/workflows/atlantis-base.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ concurrency:
2323

2424
jobs:
2525
build:
26+
strategy:
27+
matrix:
28+
image_type: [alpine]
2629
runs-on: ubuntu-22.04
30+
env:
31+
DOCKER_FILE: "Dockerfile.${{ matrix.image_type }}"
32+
IMAGE_SUFFIX: ${{ !contains(matrix.image_type, 'alpine') && '-${{ matrix.image_type }}' || '' }}
2733
steps:
2834
- uses: actions/checkout@v3
2935

@@ -42,16 +48,20 @@ jobs:
4248
registry: ghcr.io
4349
username: ${{ github.actor }}
4450
password: ${{ secrets.GITHUB_TOKEN }}
45-
- run: echo "TODAY=$(date +"%Y.%m.%d")" >> $GITHUB_ENV
51+
52+
- name: Populate release version
53+
run: echo "TODAY=$(date +"%Y.%m.%d")" >> $GITHUB_ENV
4654

4755
- name: Build and push atlantis-base:${{env.TODAY}} image
4856
uses: docker/build-push-action@v3
4957
with:
5058
cache-from: type=gha
5159
cache-to: type=gha,mode=max
5260
context: docker-base
61+
file: ${{ env.DOCKER_FILE }}
5362
platforms: linux/arm64/v8,linux/amd64,linux/arm/v7
5463
push: ${{ github.event_name != 'pull_request' }}
5564
tags: |
56-
ghcr.io/${{ github.repository_owner }}/atlantis-base:${{env.TODAY}}
57-
ghcr.io/${{ github.repository_owner }}/atlantis-base:latest
65+
ghcr.io/${{ github.repository_owner }}/atlantis-base:${{ env.TODAY }}${{ env.IMAGE_SUFFIX }}
66+
ghcr.io/${{ github.repository_owner }}/atlantis-base:latest${{ env.IMAGE_SUFFIX }}
67+
ghcr.io/${{ github.repository_owner }}/atlantis-base:${{ matrix.image_type }}

.github/workflows/atlantis-image.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- v*.*.*-pre.* # pre release like, v0.19.0-pre.calendardate
1010
pull_request:
1111
paths:
12-
- 'Dockerfile'
12+
- 'Dockerfile.alpine'
1313
- '.github/workflows/atlantis-image.yml'
1414
workflow_dispatch:
1515

@@ -19,12 +19,18 @@ concurrency:
1919

2020
jobs:
2121
build:
22+
strategy:
23+
matrix:
24+
image_type: [alpine]
2225
runs-on: ubuntu-22.04
2326
env:
2427
RELEASE_TYPE: ${{ contains(github.ref, 'pre') && 'pre' || 'stable' }}
2528
RELEASE_TAG: ${{ contains(github.ref, 'pre') && 'prerelease-latest' || 'latest' }}
29+
DOCKER_FILE: "Dockerfile.${{ matrix.image_type }}"
30+
IMAGE_SUFFIX: ${{ !contains(matrix.image_type, 'alpine') && '-${{ matrix.image_type }}' || '' }}
2631
steps:
2732
- uses: actions/checkout@v3
33+
2834
- uses: actions/setup-go@v3
2935
with:
3036
go-version: 1.19
@@ -53,13 +59,14 @@ jobs:
5359
cache-from: type=gha
5460
cache-to: type=gha,mode=max
5561
context: .
62+
file: ${{ env.DOCKER_FILE }}
5663
platforms: linux/arm64/v8,linux/amd64,linux/arm/v7
5764
push: ${{ github.event_name != 'pull_request' }}
5865
tags: |
59-
ghcr.io/${{ github.repository_owner }}/atlantis:dev
66+
ghcr.io/${{ github.repository_owner }}/atlantis:dev${{ env.IMAGE_SUFFIX }}
6067
6168
# Publish release to container registry
62-
- name: populate release version
69+
- name: Populate release version
6370
if: |
6471
contains(fromJson('["push", "pull_request"]'), github.event_name) &&
6572
startsWith(github.ref, 'refs/tags/')
@@ -74,8 +81,9 @@ jobs:
7481
cache-from: type=gha
7582
cache-to: type=gha,mode=max
7683
context: .
84+
file: ${{ env.DOCKER_FILE }}
7785
platforms: linux/arm64/v8,linux/amd64,linux/arm/v7
7886
push: ${{ github.event_name != 'pull_request' }}
7987
tags: |
80-
ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_VERSION }}
81-
ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_TAG }}
88+
ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_VERSION }}${{ env.IMAGE_SUFFIX }}
89+
ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_TAG }}${{ env.IMAGE_SUFFIX }}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)