Skip to content

docker-img: specify commit id for 3rd-part github actions #5

docker-img: specify commit id for 3rd-part github actions

docker-img: specify commit id for 3rd-part github actions #5

Workflow file for this run

name: Build and deploy Docker images
on: push
jobs:
build:
name: Build image '${{ matrix.version }}'
if: ${{ github.repository_owner == 'varigit' }}
strategy:
matrix:
version:
- 14.04
- 16.04
- 18.04
- 20.04
- 22.04
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Get commit SHA
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Login to GitHub Packages
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc
with:
context: .
push: true
tags:
ghcr.io/${{ github.repository }}/yocto-env:${{ matrix.version }}-${{ env.SHORT_SHA }},
ghcr.io/${{ github.repository }}/yocto-env:${{ matrix.version }}-latest
file: Dockerfile_${{ matrix.version }}