update to push to GCHR #4
Workflow file for this run
This file contains hidden or 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
name: Build and publish to GHCR | ||
on: | ||
workflow_call: | ||
inputs: | ||
image_base_name: | ||
required: true | ||
type: string | ||
docker_file: | ||
required: false | ||
type: string | ||
default: Dockerfile | ||
tag_value: | ||
required: true | ||
type: string | ||
checkout_submodules: | ||
type: boolean | ||
required: false | ||
default: false | ||
jobs: | ||
push-docker: | ||
name: Push Docker Image to GHCR @ ${{ inputs.tag_value }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
upadte-gchr | ||
- name: Checkout Repository | ||
- name: Echo Deprecation Warning | ||
run: | | ||
echo "::warning Deprecated action. Migrate to branch_ci.yml and tagged_ci.yml" | ||
- name: Checkout | ||
main | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
submodules: ${{ inputs.checkout_submodules }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Generate Docker Image Metadata | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: | | ||
ghcr.io/openclimatefix/${{ inputs.image_base_name }} | ||
tags: | | ||
type=raw,value=${{ inputs.tag_value }} | ||
flavor: latest=true | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and Push Docker Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ${{ inputs.docker_file }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |