Skip to content

Merge pull request #23 from Automattic/team_sync #41

Merge pull request #23 from Automattic/team_sync

Merge pull request #23 from Automattic/team_sync #41

Workflow file for this run

name: Create and publish docker image to GitHub Container Registry
on:
workflow_dispatch:
push:
branches: ['develop']
env:
REGISTRY: ghcr.io
IMAGE_NAME: ""
jobs:
call-run-tests:
uses: ./.github/workflows/run-tests.yml
build-and-push-image:
needs: call-run-tests
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Lowercase IMAGE_NAME
run: |
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}