-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (45 loc) · 1.36 KB
/
docker-base.yml
File metadata and controls
53 lines (45 loc) · 1.36 KB
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
name: Build base container image
on:
# rebuild image with updated patches each night:
schedule:
- cron: '0 4 * * *' # Runs every day at 04:00 UTC
workflow_dispatch:
# to test base image build in a pr:
# pull_request:
# branches: [ "main" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: 'mapforge-org/mapforge-base'
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Login against docker.io
- name: Log into registry docker.io
uses: docker/login-action@v4
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: .
file: ./.github/Dockerfile.base
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max