Skip to content

Test docker multi-platform #57

Test docker multi-platform

Test docker multi-platform #57

name: Test docker multi-platform
on:
# # Uncomment when test added first time to register workflow and comment it back after workflow would be registered
# #
# # Added pull_request to register workflow from the PR.
# # Read more https://stackoverflow.com/questions/63362126/github-actions-how-to-run-a-workflow-created-on-a-non-master-branch-from-the-wo
# pull_request: {}
workflow_dispatch: {}
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Setup
run: echo "Do setup"
test:
runs-on: ubuntu-latest
needs: [setup]
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./
id: current
with:
workdir: ./test/custom
file: Dockerfile_multi_platform
organization: ${{ github.event.repository.owner.login }}
repository: ${{ github.event.repository.name }}
registry: registry.hub.docker.com
login: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
platforms: linux/amd64,linux/arm64
- name: Inspect Image
run: |
docker buildx imagetools inspect ${{ steps.current.outputs.image }}:${{ steps.current.outputs.tag }} --raw | jq
- uses: nick-fields/assert-action@v1
with:
expected: 'registry.hub.docker.com/cloudposse/github-action-docker-build-push'
actual: ${{ steps.current.outputs.image }}
- uses: nick-fields/assert-action@v1
with:
expected: sha-${{ github.sha }}
actual: ${{ steps.current.outputs.tag }}
- uses: nick-fields/assert-action@v1
with:
expected: 'containerimage.buildinfo/linux/amd64'
actual: ${{ steps.current.outputs.metadata }}
comparison: contains
- uses: nick-fields/assert-action@v1
with:
expected: 'containerimage.buildinfo/linux/arm64'
actual: ${{ steps.current.outputs.metadata }}
comparison: contains
teardown:
runs-on: ubuntu-latest
needs: [test]
if: ${{ always() }}
steps:
- name: Tear down
run: echo "Do Tear down"