Skip to content

Commit

Permalink
build: make multi-platform image for testing-env
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Dec 16, 2021
1 parent 4a57b30 commit 7b76df7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/testing-env-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,41 @@ name: testing-env-image
on:
push:
paths:
- 'testing/**'
- '.github/workflows/testing-env-image.yml'
- "testing/**"
- ".github/workflows/testing-env-image.yml"
branches:
- 'master'
- "master"
workflow_dispatch:

defaults:
run:
working-directory: testing

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- 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 }}

- run: echo "TODAY=$(date +"%Y.%m.%d")" >> $GITHUB_ENV
- name: build testing-env:${{env.TODAY}} image
run: |
docker build -t ghcr.io/runatlantis/testing-env:${{env.TODAY}} .
- name: publish testing-env:${{env.TODAY}} image
run: |
docker push ghcr.io/runatlantis/testing-env:${{env.TODAY}}
docker tag ghcr.io/runatlantis/testing-env:${{env.TODAY}} ghcr.io/runatlantis/testing-env:latest
docker push ghcr.io/runatlantis/testing-env:latest
- name: Build and push testing-env:${{env.TODAY}} image
uses: docker/build-push-action@v2
with:
context: testing
platforms: linux/arm64/v8,linux/amd64,linux/arm/v7
push: true
tags: |
ghcr.io/runatlantis/testing-env:${{env.TODAY}}
ghcr.io/runatlantis/testing-env:latest
2 changes: 1 addition & 1 deletion testing/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM circleci/golang:1.17
FROM golang:1.17

# Install Terraform
ENV TERRAFORM_VERSION=1.1.1
Expand Down

0 comments on commit 7b76df7

Please sign in to comment.