This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
forked from ibz/lightning-shell
-
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (72 loc) · 2.35 KB
/
push.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Build images on push
permissions:
packages: write
on:
push:
branches:
- main
jobs:
build:
name: Build image
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
architecture:
- "arm64"
- "amd64"
base:
- "buster"
# - "bullseye"
steps:
- name: Checkout project
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set env variables
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" >> $GITHUB_ENV
echo "IMAGE_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/#-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Setup Docker buildx action
uses: docker/setup-buildx-action@v1
- name: Run Docker buildx
run: |
./generate-dockerfiles.sh
docker buildx build --platform linux/${{ matrix.architecture }} \
--tag ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}:${BRANCH}-${{ matrix.base }}-slim-${{ matrix.architecture }} --output "type=registry" \
--build-arg arch=${{ matrix.architecture }} \
--build-arg version=${BRANCH} \
--file Dockerfile.${{ matrix.base }} \
./
create-manifest:
name: Create two-architecture manifest
runs-on: ubuntu-20.04
needs: build
strategy:
matrix:
base:
- "buster"
# - "bullseye"
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Set env variables
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" >> $GITHUB_ENV
echo "IMAGE_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/#-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create final manifest
run: ./create-manifest.sh "ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}" "${BRANCH}" "${{ matrix.base }}-slim"