generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 23
35 lines (28 loc) · 1.34 KB
/
build_base_image.yaml
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
# Copyright (c) 2023 - 2023, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
# This workflow builds the base Docker image. The base image will be pushed to ghcr.io.
# This base image contains the necessary components to build and run the Docker image.
name: Build base image
on: workflow_dispatch
permissions:
contents: read
jobs:
build-base-image:
name: Build base image
runs-on: ubuntu-latest
permissions:
packages: write # To push the base Docker image.
steps:
- name: Check out repository
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
# The log in step is necessary to push the image to ghcr.io.
- name: Log in to GitHub Container Registry
run: docker login ghcr.io --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }}
# Build and push the base image using docker/Dockerfile.base. Note that this build
# only requires docker/Dockerfile.base. The base image will be tagged with ghcr.io/oracle/macaron-base:latest.
- name: Build and push the base image
run: |
docker build -t ghcr.io/oracle/macaron-base:latest -f docker/Dockerfile.base docker/
docker push ghcr.io/oracle/macaron-base:latest