Build and test linux/arm64 image and update deployment to publish amd… #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
main: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Install bats | |
uses: mig4/setup-bats@v1 | |
with: | |
bats-version: 1.2.1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build test linux/amd64 Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
push: false | |
load: true | |
tags: utils-test:linux-amd64 | |
platforms: linux/amd64 | |
- name: Run tests on linux/amd64 image | |
run: UTILS_TEST_IMAGE='utils-test:linux-amd64' bats test/test.bats | |
- name: Build test linux/arm64 Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
push: false | |
load: true | |
tags: utils-test:linux-arm64 | |
platforms: linux/arm64 | |
- name: Run tests on linux/arm64 image | |
run: UTILS_TEST_IMAGE='utils-test:linux-arm64' bats test/test.bats | |
- name: Build and push production Docker images | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: arunvelsriram/utils:latest |