-
Notifications
You must be signed in to change notification settings - Fork 9
71 lines (62 loc) · 2.62 KB
/
update-xversion.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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