-
Notifications
You must be signed in to change notification settings - Fork 20
45 lines (35 loc) · 1.17 KB
/
docker-img.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 }}