Build tutorial Docker Image #18
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 Docker Image | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths: | |
| - 'tutorial/Dockerfile' | |
| - 'tutorial/root/**' | |
| - '.github/workflows/build-docker-tutorial.yml' | |
| workflow_run: | |
| workflows: | |
| - Build code-server Docker Image | |
| types: | |
| - completed | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker metadata | |
| uses: docker/metadata-action@v5 | |
| id: metadata | |
| with: | |
| images: | | |
| ghcr.io/${{ github.repository_owner }}/bootcamp | |
| tags: | | |
| tutorial | |
| labels: | | |
| maintainer=${{ github.repository_owner }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: tutorial | |
| platforms: linux/amd64 | |
| push: ${{ github.ref == 'refs/heads/master' }} | |
| tags: ${{ steps.metadata.outputs.tags }} | |
| labels: ${{ steps.metadata.outputs.labels }} |