Skip to content

Commit

Permalink
Separate out the manual vs scheduled update actions
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph Castain <[email protected]>
  • Loading branch information
rhc54 committed Oct 3, 2023
1 parent 644c9a9 commit 209095e
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
69 changes: 69 additions & 0 deletions .github/workflows/manual-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Refresh Cross Version Testing Container Image

on:
workflow_dispatch

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
2 changes: 1 addition & 1 deletion .github/workflows/update-xversion.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Refresh Cross Version Testing Container Image

on:
[schedule, workflow_dispatch]:
schedule:
# Run once a week on Sunday (UTC)
- cron: '0 1 * * 0'

Expand Down

0 comments on commit 209095e

Please sign in to comment.