radiosonde_auto_rx/.github/workflows/container.yml

60 wiersze
1.8 KiB
YAML
Czysty Zwykły widok Historia

2021-03-23 23:43:39 +00:00
name: Container Images
2021-02-19 16:53:20 +00:00
on:
push:
branches:
- 'testing'
tags:
- 'v*'
pull_request:
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
steps:
2021-03-23 23:43:39 +00:00
- name: Checkout Repository
2021-02-21 02:08:08 +00:00
uses: actions/checkout@v2
2021-02-19 16:53:20 +00:00
- name: Calculate Container Metadata
id: meta
2022-09-24 05:37:22 +00:00
uses: docker/metadata-action@v4
2021-02-19 16:53:20 +00:00
with:
2021-07-19 03:13:48 +00:00
images: ghcr.io/${{ github.repository }}
2021-02-19 16:53:20 +00:00
- name: Setup QEMU
2022-09-24 05:37:22 +00:00
uses: docker/setup-qemu-action@v2
2021-02-19 16:53:20 +00:00
- name: Setup Buildx
2022-09-24 05:37:22 +00:00
uses: docker/setup-buildx-action@v2
2021-02-19 16:53:20 +00:00
2021-03-23 23:43:39 +00:00
- name: Login to GitHub Container Registry
2022-09-24 08:55:50 +00:00
if: ${{ github.event_name != 'pull_request' }}
2022-09-24 05:37:22 +00:00
uses: docker/login-action@v2
2021-03-23 23:43:39 +00:00
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
2022-09-24 08:55:50 +00:00
- name: Build Images
if: ${{ github.event_name == 'pull_request' }}
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64, linux/386, linux/arm64, linux/arm/v6, linux/arm/v7
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2021-03-23 23:43:39 +00:00
- name: Build and Push Images
2022-09-24 08:55:50 +00:00
if: ${{ github.event_name != 'pull_request' }}
2022-09-23 07:13:57 +00:00
uses: docker/build-push-action@v3
2021-02-19 16:53:20 +00:00
with:
2021-02-21 02:08:08 +00:00
context: .
2021-02-19 16:53:20 +00:00
platforms: linux/amd64, linux/386, linux/arm64, linux/arm/v6, linux/arm/v7
2022-09-23 07:13:57 +00:00
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
2022-09-24 08:55:50 +00:00
push: true
2021-02-19 16:53:20 +00:00
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}