add README.md #27
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 Container | ||
| on: | ||
| workflow_dispatch: | ||
| registry_package: | ||
| types: [published] | ||
| env: | ||
| REGISTRY: ghcr.io | ||
| GITHUB_REPO: ${{ github.repository }} | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| docker: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
| - uses: oven-sh/setup-bun@v2 | ||
| - run: bun install | ||
| - name: generate Dockerfile | ||
| run: bun run main.ts | ||
| - name: Log in to the Container registry | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Extract metadata (tags, labels) for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v6 | ||
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.GITHUB_REPO }}-docs | ||
| tags: | | ||
| type=sha | ||
| type=raw,value=latest | ||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v7 | ||
| with: | ||
| context: generated | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| build-args: | | ||
| repo_url=https://github.com/${{ env.GITHUB_REPO }} | ||
| site_url=${{ secrets.SITE_URL }}/${{ github.ref_name }}/ | ||
| edit_url=edit/${{ github.ref_name }}/docs/src/ | ||