-
-
Notifications
You must be signed in to change notification settings - Fork 88
58 lines (52 loc) · 1.57 KB
/
nightly.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
name: nightly
on:
schedule:
- cron: '0 10 * * *' # everyday at 10am
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
docker:
name: 'Nightly Build'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2'
- uses: extractions/setup-just@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: clux
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build nightly image
uses: docker/build-push-action@v2
with:
context: .
push: false
build-args: |
CHANNEL=nightly
tags: clux/muslrust:temp
- name: Compute tags
shell: bash
run: |
docker run clux/muslrust:temp rustc --version
RUST_VER="$(docker run clux/muslrust:temp rustc --version | grep -oE "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]")"
RUST_DATE="$(date +"%Y-%m-%d")"
RUST_CHANNEL=nightly
echo "TAG1=clux/muslrust:${RUST_CHANNEL}" >> $GITHUB_ENV
echo "TAG2=clux/muslrust:${RUST_CHANNEL}-${RUST_DATE}" >> $GITHUB_ENV
echo "TAG3=clux/muslrust:${RUST_VER}-${RUST_CHANNEL}-${RUST_DATE}" >> $GITHUB_ENV
- name: Run tests
shell: bash
run: just test
- name: Push image under computed tags
uses: docker/build-push-action@v2
with:
context: .
build-args: |
CHANNEL=nightly
push: ${{ github.event_name != 'pull_request' }}
tags: clux/muslrust:latest,${{ env.TAG1 }},${{ env.TAG2 }},${{ env.TAG3 }}