Skip to content

Container Build And Upload #8

Container Build And Upload

Container Build And Upload #8

name: Container Build And Upload
description: |
Builds and uploads to GHCR (GitHub Container Registry) the container used to build the packages
on:
workflow_dispatch:
inputs:
variant:
description: The variant name to be appended to the image name, default is 'latest'
type: string
default: latest
permissions:
contents: read
security-events: write
env:
QCOM_ORG_NAME: "qualcomm-linux"
IMAGE_NAME: "pkg-builder"
jobs:
container-build-and-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout Dockerfile
uses: actions/checkout@v4
with:
ref: ${{github.head_ref}}
sparse-checkout: docker/Dockerfile
sparse-checkout-cone-mode: false # single file -> false
- name: Authenticate to GHCR
run: echo ${{ secrets.DEB_PKG_BOT_CI_TOKEN }} | docker login ghcr.io -u ${{ vars.DEB_PKG_BOT_CI_USERNAME }} --password-stdin
- name: Build and Tag the Image
run: docker build -t ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:${{inputs.variant}} ./docker
- name: Push
run: ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:${{inputs.variant}}