This repository was archived by the owner on Nov 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (49 loc) · 1.73 KB
/
docker-runner.yml
File metadata and controls
57 lines (49 loc) · 1.73 KB
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
name: "Deploy runner"
on:
workflow_dispatch: # Allows workflow to be triggered manually
schedule:
- cron: "0 9 * * 0" # every Sunday at 9:00am
jobs:
build-and-push-nightly:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
deployment: [nightly, latest]
steps:
- uses: actions/checkout@v3
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
- name: Set build args
id: build_args
run: |
if [ ${{ matrix.deployment }} != 'nightly' ]; then
echo "::set-output name=build_arg::False"
echo "build-arg set for Latest"
else
echo "::set-output name=build_arg::True"
echo "build-arg set for Nightly"
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: container/runner_py38_mantid.Dockerfile
build-args: NIGHTLY=${{ steps.build_args.outputs.build_arg }}
push: true
tags: |
ghcr.io/autoreduction/runner-mantid:${{ matrix.deployment }}
ghcr.io/autoreduction/runner-mantid:${{ steps.date.outputs.date }}-${{ matrix.deployment }}
cache-from: type=registry,ref=ghcr.io/autoreduction/runner-mantid:${{ matrix.deployment }}
cache-to: type=inline