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
|
2022-06-19 05:43:41 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-02-24 21:17:25 +01:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2022-06-19 05:43:30 +02:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2021-04-05 04:55:34 +02:00
|
|
|
|
|
|
|
- name: Log into registry
|
2022-06-19 05:43:36 +02:00
|
|
|
uses: docker/login-action@v2
|
2022-02-24 21:17:25 +01:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2021-04-05 04:55:34 +02:00
|
|
|
|
|
|
|
- name: Build Linux image
|
2022-06-20 04:32:51 +02:00
|
|
|
uses: docker/build-push-action@v3
|
2022-02-24 21:17:25 +01:00
|
|
|
with:
|
|
|
|
context: tools/ci/docker/linux
|
|
|
|
load: true
|
|
|
|
tags: ${{ env.IMAGE_TAG }}
|
|
|
|
|
2021-04-05 04:55:34 +02:00
|
|
|
- name: Push Linux image
|
2022-06-20 04:32:51 +02:00
|
|
|
uses: docker/build-push-action@v3
|
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 }}
|