Skip to content

Update build_deb_package.yml #6

Update build_deb_package.yml

Update build_deb_package.yml #6

# This is a basic workflow to help you get started with Actions
name: Package OVIS-LDMS SlingShot Switch Sampler for Debian ARM64
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "debian" ]
pull_request:
branches: [ "debian" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu:latest
env:
DOCKER_REGISTRY: docker.io
DOCKER_IMAGE: ubuntu:latest
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_TARGET_PLATFORM: linux/arm/v7
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v1
- uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Prepare
if: success()
id: prepare
run: |
echo ::set-output name=docker_platform::${DOCKER_TARGET_PLATFORM}
echo ::set-output name=docker_image::${DOCKER_REGISTRY}/${DOCKER_IMAGE}
echo ::set-output name=version::${GITHUB_RUN_NUMBER}
- name: Docker Login
if: success()
run: |
echo "${DOCKER_PASSWORD}" | docker login ${DOCKER_REGISTRY} --username "${DOCKER_USERNAME}" --password-stdin
- name: Run Buildx (push image)
if: success()
run: |
docker buildx build \
--platform ${{ steps.prepare.outputs.docker_platform }} \
--tag ${{steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }} \
--file ./Dockerfile \
--output type=image,push=true .