Update main.yml #41
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: Docker image CI | |
on: | |
push: | |
branches: ['dynamic_repo'] | |
workflow_dispatch: | |
env: | |
IMAGE_TAG: latest | |
REPO_URL: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: build Docker image | |
run: | | |
docker build . --tag ghcr.io/${{ env.REPO_URL }}:${{ env.IMAGE_TAG }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push Docker image to GitHub Container Registry | |
run: | | |
docker push ghcr.io/${{ env.REPO_URL }}:${{ env.IMAGE_TAG }} | |