forked from space-ros/space-ros
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (53 loc) · 1.76 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
53
name: Earthly build
on:
workflow_dispatch:
push:
branches: ['main']
tags: ['*']
pull_request:
schedule:
- cron: '0 11 * * *'
jobs:
matrix:
os: [ubuntu-latest, macos-latest]
build-testing-results:
runs-on: ${{ matrix.os }}
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: |
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: log/build_results_archives/${{env.archivename}}
if-no-files-found: error
space-ros-image:
runs-on: ${{ matrix.os }}
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: |
earthly --ci --output +sources
earthly --ci +image
- name: Push spaceros image
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_RW_TOKEN }}
if: ${{ github.ref_type == 'tag' }}
run: |
echo $DOCKER_HUB_TOKEN | docker login --username osrfbot --password-stdin
earthly --ci --push +image --tag=${{ github.ref_name }}