Files
atlantis/.github/workflows/atlantis-image.yml
rui 45e8513f23 docker: make multi-platform atlantis image (#1943)
* docker: multi-platform image for atlantis

* workflow: update for multi platform image builds

Signed-off-by: Rui Chen <rui@chenrui.dev>

* update branch trigger for testing dev image

Signed-off-by: Rui Chen <rui@chenrui.dev>

* revert to use testing-env:2021.08.31

Signed-off-by: Rui Chen <rui@chenrui.dev>

* Revert "update branch trigger for testing dev image"

This reverts commit 266e04da08.
2021-12-17 14:41:05 -05:00

62 lines
1.6 KiB
YAML

name: atlantis-image
on:
push:
branches:
- "master"
release:
types:
- "published"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
image: tonistiigi/binfmt:latest
platforms: arm64,arm
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Packages Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Publish dev image to container registry
- name: Build and push atlantis:dev image
if: ${{ github.event_name == 'push'}}
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/arm64/v8,linux/amd64,linux/arm/v7
push: true
tags: |
ghcr.io/runatlantis/atlantis:dev
# Publish release to container registry
- name: populate release version
if: ${{ github.event_name == 'release'}}
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build and push atlantis:$RELEASE_VERSION image
if: ${{ github.event_name == 'release'}}
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/arm64/v8,linux/amd64,linux/arm/v7
push: true
tags: |
ghcr.io/runatlantis/atlantis:$RELEASE_VERSION
ghcr.io/runatlantis/atlantis:latest