Skip to content

ADS-B Exchange connection frequency #424

ADS-B Exchange connection frequency

ADS-B Exchange connection frequency #424

name: Pull Request publish
on:
issue_comment:
types: [created]
env:
# TODO: Change variable to your image's name.
IMAGE_NAME: thomx/fr24feed-piaware
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
is_deploy_comment:
outputs:
is_deploy: ${{ steps.check.outputs.triggered }}
# Ensure test job passes before pushing image.
runs-on: ubuntu-latest
if: github.event.issue.pull_request
steps:
- name: If deploy comment
uses: khan/[email protected]
id: check
with:
trigger: '@deploy'
reaction: rocket
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
test:
needs: is_deploy_comment
if: needs.is_deploy_comment.outputs.is_deploy == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'refs/pull/${{ github.event.issue.number }}/merge'
- name: Get commit
id: get_commit
run: |
echo "sha_short=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: all-buildx-${{ steps.get_commit.outputs.sha_short }}
restore-keys: |
all-buildx-
- name: Build
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
push: false
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
# Push image to GitHub Packages and Docker Hub.
push:
# Ensure test job passes before pushing image.
needs: test
environment: docker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'refs/pull/${{ github.event.issue.number }}/merge'
- name: Get commit
id: get_commit
run: |
echo "sha_short=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: all-buildx-${{ steps.get_commit.outputs.sha_short }}
restore-keys: |
all-buildx-
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get tags list
id: tags
run: |
TAGS=$IMAGE_NAME:PR-${{ github.event.issue.number }}
echo TAGS=$TAGS
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
push: true
tags: ${{ steps.tags.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache