Buildx #1810
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Buildx | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
setup: | |
runs-on: ubuntu-22.04 | |
outputs: | |
gitRefs: ${{ steps.builds.outputs.gitRefs }} | |
alpineTasks: ${{ steps.builds.outputs.alpineTasks }} | |
debianTasks: ${{ steps.builds.outputs.debianTasks }} | |
steps: | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- uses: actions/checkout@v4 | |
- id: builds | |
run: deno run --allow-net --allow-read --allow-write --allow-env src/main.ts | |
checkout: | |
runs-on: ubuntu-22.04 | |
needs: | |
- setup | |
strategy: | |
matrix: | |
gitRef: ${{ fromJSON(needs.setup.outputs.gitRefs) }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'merbanan/rtl_433' | |
ref: ${{ matrix.gitRef }} | |
- run: git archive ${{ matrix.gitRef }} --format tar.gz --output ${{ matrix.gitRef }}.tar.gz | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.gitRef }} | |
path: ${{ matrix.gitRef }}.tar.gz | |
alpine: | |
name: ${{ matrix.name }} | |
needs: | |
- setup | |
- checkout | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
include: ${{ fromJSON(needs.setup.outputs.alpineTasks) }} | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
with: | |
version: latest | |
config-inline: | | |
[registry."docker.io"] | |
mirrors = ["mirror.gcr.io"] | |
- if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'hertzg/rtl_433_docker' }} | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.gitRef }} | |
path: ${{ matrix.context }} | |
- run: | | |
cd ${{ matrix.context }} | |
mkdir rtl_433 | |
tar xf ${{ matrix.gitRef }}.tar.gz --directory ./rtl_433 | |
rm -f ${{ matrix.gitRef }}.tar.gz | |
- uses: docker/build-push-action@v5 | |
with: | |
context: ${{ matrix.context }} | |
file: ${{ matrix.file }} | |
build-args: ${{ matrix.buildArgs }} | |
platforms: ${{ matrix.platforms }} | |
pull: true | |
push: ${{ github.ref == 'refs/heads/master' || github.event_name == 'schedule' }} | |
cache-from: ${{ matrix.cacheFrom }} | |
cache-to: ${{ matrix.cacheTo }} | |
tags: ${{ matrix.tags }} | |
debian: | |
name: ${{ matrix.name }} | |
needs: | |
- setup | |
- checkout | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
include: ${{ fromJSON(needs.setup.outputs.debianTasks) }} | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
with: | |
version: latest | |
config-inline: | | |
[registry."docker.io"] | |
mirrors = ["mirror.gcr.io"] | |
- if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'hertzg/rtl_433_docker' }} | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.gitRef }} | |
path: ${{ matrix.context }} | |
- run: | | |
cd ${{ matrix.context }} | |
mkdir rtl_433 | |
tar xf ${{ matrix.gitRef }}.tar.gz --directory ./rtl_433 | |
rm -f ${{ matrix.gitRef }}.tar.gz | |
- uses: docker/build-push-action@v5 | |
with: | |
context: ${{ matrix.context }} | |
file: ${{ matrix.file }} | |
build-args: ${{ matrix.buildArgs }} | |
platforms: ${{ matrix.platforms }} | |
pull: true | |
push: ${{ github.ref == 'refs/heads/master' || github.event_name == 'schedule' }} | |
cache-from: ${{ matrix.cacheFrom }} | |
cache-to: ${{ matrix.cacheTo }} | |
tags: ${{ matrix.tags }} |