Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev rnd 2198 ci add var host docker containers to docker hub #9

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/docker-img.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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@v3

- 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@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
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 }}

1 change: 1 addition & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: (GPL-2.0+ OR MIT)
# Copyright 2021 Variscite Ltd.


readonly FILE_SCRIPT="$(basename "$0")"
readonly DIR_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
readonly GIT_COMMIT="$(git --git-dir=${DIR_SCRIPT}/.git log -1 --format=%h)"
Expand Down