-
Notifications
You must be signed in to change notification settings - Fork 6
54 lines (43 loc) · 1.97 KB
/
docker-publish.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
name: Scheduled Publish
on:
schedule:
- cron: '22 3 * * 0'
workflow_dispatch:
env:
BASE_DEVEL_IMG: base-devel
LATEST_IMG: latest
BASE_IMG: base
# IMPORTANT NOTE: The first time this automation is run, the invoked container in "image" field must access to Athena and Chaotic repositories otherwise
# when the building image tries to install chaotic-mirrorlist, it cannot find the package because the invoked container is not linked to its repository.
# It is the case where the original athenaos/base-devel image in Docker Hub is corrupted or has been pushed an image with no repositories reported above.
# In this case, just push the Athena Base-devel image atleast one time to Docker by using your local Athena machine with Athena and Chaotic repositories enabled.
jobs:
publish:
runs-on: ubuntu-latest
container:
image: athenaos/base-devel:latest
steps:
- uses: actions/checkout@v4
- name: Set fastest mirrors
run: |
pacman -Syyu --noconfirm reflector
reflector --age 6 --connection-timeout 15 --download-timeout 15 --latest 21 --fastest 21 --threads 21 --sort rate --protocol https --save /etc/pacman.d/mirrorlist
- name: Install dependencies
run: pacman -Syyu --noconfirm --needed make docker docker-buildx devtools fakeroot fakechroot
- name: Build base
run: |
make athena-base
docker tag athenaos/base docker.io/athenaos/$BASE_IMG:$LATEST_IMG
- name: Build base-devel
run: |
make athena-base-devel
docker tag athenaos/base-devel docker.io/athenaos/$BASE_DEVEL_IMG:$LATEST_IMG
- name: Log into registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Push image
run: |
docker push docker.io/athenaos/$BASE_IMG:$LATEST_IMG
docker push docker.io/athenaos/$BASE_DEVEL_IMG:$LATEST_IMG