Create docker-build.yml #1
This file contains hidden or 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: Build Tutorial Container | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '*.md' | |
- slides/** | |
- images/** | |
- .gitignore | |
workflow_dispatch: | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Log in to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build the Docker image | |
run: | | |
docker build -t ghcr.io/${{ github.repository }}:latest . | |
- name: Push the Docker image | |
run: | | |
docker push ghcr.io/${{ github.repository }}:latest |