Adjust the image name of private repo #10
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
name: Create and Publish the Docker Image | |
on: | |
push: | |
branches: ["master"] | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3.0.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to Private Container Registry | |
uses: docker/login-action@v3.0.0 | |
with: | |
registry: ${{ secrets.TEACON_REGISTRY }} | |
username: ${{ secrets.TEACON_REGISTRY_USERNAME }} | |
password: ${{ secrets.TEACON_REGISTRY_TOKEN }} | |
- name: Extract Metadata for Docker | |
id: meta | |
uses: docker/metadata-action@v5.0.0 | |
with: | |
images: | | |
${{ secrets.TEACON_REGISTRY }}/teaconmc/chahoutan | |
ghcr.io/${{ github.repository_owner }}/chahoutan | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |