Skip to content

ci: add docker login action #5

ci: add docker login action

ci: add docker login action #5

Workflow file for this run

name: Release Logica Sandbox MySQL Docker Image
on:
push:
branches: ['main']
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: rise8-us/logica-sandbox-infra/mysql
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log in to the Container registry
uses: docker/#-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.3.0
with:
images: |
ghcr.io/rise8-us/logica-sandbox-infra/mysql
tags: |
type=sha
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Build and push Docker image
uses: docker/build-push-action@v5.1.0
with:
context: ./mysql
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64