Skip to content

added dockerhub image #16

added dockerhub image

added dockerhub image #16

Workflow file for this run

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Create and inspect a Docker image
on:
push:
branches:
- '**'
- '!main'
pull_request:
branches:
- 'main'
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3.4.0
- name: downcase REPO
run: echo "REPO=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
- name: Set year
run: echo "BUILD_YEAR=$(date +%Y)" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.3.0
with:
images: |
ghcr.io/${{ env.REPO }}
- name: Build and load image
uses: docker/build-push-action@v4.0.0
with:
context: ./docker/
push: false
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: YEAR=${{ env.BUILD_YEAR }}
- name: Inspect Docker image
run: docker image inspect ghcr.io/${{ env.REPO }}:${{ env.BRANCH_NAME }}