Skip to content

Refresh Cross Version Testing Container Image #99

Refresh Cross Version Testing Container Image

Refresh Cross Version Testing Container Image #99

name: Refresh Cross Version Testing Container Image
on:
schedule:
# Run once a week on Sunday (UTC)
- cron: '0 1 * * 0'
env:
# Use docker.io for Docker Hub if empty
REGISTRY: docker.io
# github.repository as <account>/<repo>
IMAGE_NAME: jjhursey/pmix-xver-tester
jobs:
build:
# Do not run on fork's of this repo
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif
if: github.repository == 'openpmix/pmix-tests'
runs-on: ubuntu-latest
environment: Docker Registry Auth
steps:
# Update the built timestamp to force refresh
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d at %H:%M %Z')"
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v2
# QEMU to allow us to build for different architectures
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# Allows us to build and push multi-arch containers
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Login against a container registry
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
# Note: I'm not sure why $GITHUB_WORKSPACE is not being resolved properly
# here in the mean time just use the full path.
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: /home/runner/work/pmix-tests/pmix-tests/crossversion/support/
# Other platforms can be added in a comma separated list.
# See the QEMU link above for supported architectures
# Note that non-amd64 will take a long time due to QEMU virtualization
# but they do seem to run in parallel.
#platforms: linux/amd64,linux/ppc64le
platforms: linux/amd64
push: true
tags: ${{ env.IMAGE_NAME }}:latest
build-args: BUILD_TIMESTAMP='${{ steps.date.outputs.date }}'
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:latest
cache-to: type=inline