-
-
Notifications
You must be signed in to change notification settings - Fork 45
71 lines (63 loc) · 2.07 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
59
60
61
62
63
64
65
66
67
68
69
70
71
name: 'Stump Nightly CI'
on:
pull_request:
branches:
- develop
push:
branches:
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
jobs:
code-changes-check:
runs-on: [ubuntu-22.04]
outputs:
changes: ${{steps.filter.outputs.changes}}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
base: 'develop'
filters: |
apps: ./apps/**
core: ./core/**
crates: ./crates/**
docker: ./docker/**
packages: ./packages/**
workflow:
- './.github/workflows/nightly.yml'
- './.github/actions/**'
nightly-docker-build:
needs: code-changes-check
if: "!contains(github.event.pull_request.head.ref, 'release/v') && needs.code-changes-check.outputs.changes != '[]'"
name: Build docker image
runs-on: [self-hosted]
steps:
- name: Checkout repository
uses: actions/checkout@v3
# The build on PRs is only for linux/amd64 as a sanity check. The build on pushes will
# actually build all the supported platforms and push them to dockerhub
- name: Configure environment
run: |
echo "LOAD=${{ github.event_name == 'pull_request' }}" >> $GITHUB_ENV
echo "PUSH=${{ github.event_name == 'push' }}" >> $GITHUB_ENV
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "ARCHS=amd64" >> $GITHUB_ENV
else
echo "ARCHS=arm64,amd64" >> $GITHUB_ENV
fi
- name: Setup and build docker image
uses: ./.github/actions/build-docker
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
tags: 'nightly'
load: ${{ env.LOAD }}
push: ${{ env.PUSH }}
archs: ${{ env.ARCHS }}
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}