Build base image #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
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 |