-
Notifications
You must be signed in to change notification settings - Fork 32
52 lines (52 loc) · 1.79 KB
/
earthly-build.yaml
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
name: Earthly build
on:
push:
branches: ['main']
pull_request:
schedule:
- cron: '0 11 * * *'
jobs:
build-testing-results:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up earthly
run: |
sudo wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly
sudo chmod 755 /usr/local/bin/earthly
- name: Build Space ROS
id: build
run: |
cd spaceros
earthly --ci --output +sources
earthly --ci --output +build-testing
echo "archivename=$(basename log/build_results_archives/build_results_*.tar.bz2)" >> $GITHUB_ENV
- name: Upload build results archive
uses: actions/upload-artifact@v3
with:
name: ${{env.archivename}}
path: spaceros/log/build_results_archives/${{env.archivename}}
if-no-files-found: error
space-ros-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up earthly
run: |
sudo wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly
sudo chmod 755 /usr/local/bin/earthly
- name: Build spaceros image
run: |
cd spaceros
earthly --ci --output +sources
earthly --ci +image
- name: Push spaceros image
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_RW_TOKEN }}
if: ${{ (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' }}
run: |
echo $DOCKER_HUB_TOKEN | docker login --username osrfbot --password-stdin
cd spaceros
earthly --ci --push +image