-
-
Notifications
You must be signed in to change notification settings - Fork 4
47 lines (38 loc) · 1.38 KB
/
kiwix-build_ci.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
name: Kiwix-build container images
on:
push:
paths:
- 'kiwix-build_ci/**'
workflow_dispatch:
env:
IMAGE_PREFIX: ghcr.io/kiwix/kiwix-build_ci_
jobs:
Container:
strategy:
fail-fast: false
matrix:
variant: [f35, focal, jammy, manylinux, alpine, noble]
runs-on: ubuntu-22.04
steps:
- name: Get current date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Retrieve the code
uses: actions/checkout@v4
- name: Setup container image name
id: env
run: |
echo "IMAGE_NAME=${{ env.IMAGE_PREFIX }}${{ matrix.variant }}" >> $GITHUB_ENV
- name: Build container image
run: |
docker build -t ${{ env.IMAGE_NAME }}:dev - < kiwix-build_ci/${{ matrix.variant }}_builder.dockerfile
- name: Upload container image to :dev
run: |
echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.GHCR_USERNAME }}" --password-stdin
docker push ${{ env.IMAGE_NAME }}:dev
- name: Update production tags
if: github.event.ref == 'refs/heads/main'
run: |
docker tag ${{ env.IMAGE_NAME }}:dev ${{ env.IMAGE_NAME }}:${{ env.DATE }}
docker push ${{ env.IMAGE_NAME }}:${{ env.DATE }}
docker tag ${{ env.IMAGE_NAME }}:dev ${{ env.IMAGE_NAME }}:latest
docker push ${{ env.IMAGE_NAME }}:latest