2021-04-05 04:55:34 +02:00
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
name: Docker-Linux
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
# Publish `master` as Docker `latest` image.
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths:
|
|
|
|
- 'tools/ci/docker/linux/**'
|
2021-04-23 01:03:09 +02:00
|
|
|
- '.github/workflows/docker_linux.yml'
|
2021-04-05 04:55:34 +02:00
|
|
|
|
|
|
|
# Run builds for any PRs.
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'tools/ci/docker/linux/**'
|
2021-04-23 01:03:09 +02:00
|
|
|
- '.github/workflows/docker_linux.yml'
|
2021-04-05 04:55:34 +02:00
|
|
|
|
|
|
|
env:
|
2021-04-22 23:57:48 +02:00
|
|
|
IMAGE_NAME: apache-nuttx-ci-linux
|
2021-04-05 04:55:34 +02:00
|
|
|
|
2021-12-17 14:48:15 +01:00
|
|
|
concurrency:
|
|
|
|
group: docker-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-06-17 02:32:28 +02:00
|
|
|
permissions:
|
2022-06-22 17:05:46 +02:00
|
|
|
packages: write
|
2022-06-17 02:32:28 +02:00
|
|
|
contents: read
|
|
|
|
|
2021-04-05 04:55:34 +02:00
|
|
|
jobs:
|
|
|
|
# Push image to GitHub Packages.
|
|
|
|
push:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2021-09-01 22:18:00 +02:00
|
|
|
IMAGE_TAG: ghcr.io/${{ github.repository }}/apache-nuttx-ci-linux
|
2021-04-05 04:55:34 +02:00
|
|
|
steps:
|
2022-02-24 21:17:25 +01:00
|
|
|
- name: Checkout repository
|
2023-09-11 04:40:23 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-02-24 21:17:25 +01:00
|
|
|
|
2023-12-07 17:12:25 +01:00
|
|
|
- name: Free Disk Space (Ubuntu)
|
2023-12-08 10:33:04 +01:00
|
|
|
uses: ./.github/actions/free-disk-space
|
2023-12-07 17:12:25 +01:00
|
|
|
with:
|
|
|
|
# this might remove tools that are actually needed,
|
|
|
|
# if set to "true" but frees about 6 GB
|
|
|
|
tool-cache: false
|
|
|
|
|
|
|
|
# all of these default to true, but feel free to set to
|
|
|
|
# "false" if necessary for your workflow
|
|
|
|
android: true
|
|
|
|
dotnet: true
|
|
|
|
haskell: true
|
|
|
|
large-packages: true
|
|
|
|
docker-images: true
|
|
|
|
swap-storage: true
|
|
|
|
|
2022-02-24 21:17:25 +01:00
|
|
|
- name: Set up Docker Buildx
|
2023-09-18 04:10:22 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2021-04-05 04:55:34 +02:00
|
|
|
|
|
|
|
- name: Log into registry
|
2023-09-18 04:10:25 +02:00
|
|
|
uses: docker/login-action@v3
|
2022-02-24 21:17:25 +01:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2022-10-16 05:05:28 +02:00
|
|
|
- name: Pre-build Disk Stats
|
|
|
|
run: |
|
|
|
|
df -h
|
2021-04-05 04:55:34 +02:00
|
|
|
- name: Push Linux image
|
2023-09-18 04:10:31 +02:00
|
|
|
uses: docker/build-push-action@v5
|
2022-02-24 21:17:25 +01:00
|
|
|
with:
|
|
|
|
context: tools/ci/docker/linux
|
|
|
|
platforms: linux/amd64
|
|
|
|
push: ${{ github.ref == 'refs/heads/master' }}
|
|
|
|
tags: ${{ env.IMAGE_TAG }}
|
2022-10-16 05:05:28 +02:00
|
|
|
- name: Post-build Disk Stats
|
|
|
|
if: always()
|
|
|
|
run: |
|
|
|
|
df -h
|