2021-04-05 10:55:34 +08: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 07:03:09 +08:00
|
|
|
- '.github/workflows/docker_linux.yml'
|
2021-04-05 10:55:34 +08:00
|
|
|
|
|
|
|
# Run builds for any PRs.
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'tools/ci/docker/linux/**'
|
2021-04-23 07:03:09 +08:00
|
|
|
- '.github/workflows/docker_linux.yml'
|
2021-04-05 10:55:34 +08:00
|
|
|
|
|
|
|
env:
|
2021-04-23 05:57:48 +08:00
|
|
|
IMAGE_NAME: apache-nuttx-ci-linux
|
2021-04-05 10:55:34 +08:00
|
|
|
|
2021-12-17 21:48:15 +08:00
|
|
|
concurrency:
|
|
|
|
group: docker-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-06-17 08:32:28 +08:00
|
|
|
permissions:
|
2022-06-22 23:05:46 +08:00
|
|
|
packages: write
|
2022-06-17 08:32:28 +08:00
|
|
|
contents: read
|
|
|
|
|
2021-04-05 10:55:34 +08:00
|
|
|
jobs:
|
|
|
|
# Push image to GitHub Packages.
|
|
|
|
push:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2021-09-02 04:18:00 +08:00
|
|
|
IMAGE_TAG: ghcr.io/${{ github.repository }}/apache-nuttx-ci-linux
|
2021-04-05 10:55:34 +08:00
|
|
|
steps:
|
2022-02-25 04:17:25 +08:00
|
|
|
- name: Checkout repository
|
2023-09-11 10:40:23 +08:00
|
|
|
uses: actions/checkout@v4
|
2022-02-25 04:17:25 +08:00
|
|
|
|
2023-12-08 00:12:25 +08:00
|
|
|
- name: Free Disk Space (Ubuntu)
|
2023-12-08 17:33:04 +08:00
|
|
|
uses: ./.github/actions/free-disk-space
|
2023-12-08 00:12:25 +08: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-25 04:17:25 +08:00
|
|
|
- name: Set up Docker Buildx
|
2023-09-18 10:10:22 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2021-04-05 10:55:34 +08:00
|
|
|
|
|
|
|
- name: Log into registry
|
2023-09-18 10:10:25 +08:00
|
|
|
uses: docker/login-action@v3
|
2022-02-25 04:17:25 +08:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2022-10-16 11:05:28 +08:00
|
|
|
- name: Pre-build Disk Stats
|
|
|
|
run: |
|
|
|
|
df -h
|
2021-04-05 10:55:34 +08:00
|
|
|
- name: Push Linux image
|
2023-09-18 10:10:31 +08:00
|
|
|
uses: docker/build-push-action@v5
|
2022-02-25 04:17:25 +08:00
|
|
|
with:
|
|
|
|
context: tools/ci/docker/linux
|
|
|
|
platforms: linux/amd64
|
|
|
|
push: ${{ github.ref == 'refs/heads/master' }}
|
|
|
|
tags: ${{ env.IMAGE_TAG }}
|
2022-10-16 11:05:28 +08:00
|
|
|
- name: Post-build Disk Stats
|
|
|
|
if: always()
|
|
|
|
run: |
|
|
|
|
df -h
|