Skip to content

Commit

Permalink
Merge branch 'master' of github.com:squidfunk/mkdocs-material
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Feb 26, 2023
2 parents a90f176 + 1757931 commit 0f74615
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 109 deletions.
99 changes: 95 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@

name: build
on:
- push
- pull_request
push:
branches:
- master
pull_request:
release:
types:
- published

env:
NODE_VERSION: 14.x
PYTHON_VERSION: 3.x

permissions:
contents: read

jobs:
build:
name: Build project
npm:
runs-on: ubuntu-latest
steps:

Expand Down Expand Up @@ -61,3 +66,89 @@ jobs:
run: |
npm run build
git diff --name-only
pypi:
runs-on: ubuntu-latest
steps:

- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python runtime
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set up Python dependencies
run: pip install --upgrade build twine

- name: Build Python package
run: python -m build

- name: Publish Python package
if: github.event_name == 'release'
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload --disable-progress-bar -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} dist/*

docker:
runs-on: ubuntu-latest
steps:

- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
if: github.event_name == 'release'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
if: github.event_name == 'release'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Generate Docker tags and labels
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ github.event.repository.full_name }}
ghcr.io/${{ github.event.repository.full_name }}
tags: |
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
flavor: |
latest=${{ github.event.release.prerelease == false }}
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Check Docker image
working-directory: /tmp
run: |
docker run --rm -i -v ${PWD}:/docs ${{ github.event.repository.full_name }}:${{ steps.meta.outputs.version }} new .
docker run --rm -i -v ${PWD}:/docs ${{ github.event.repository.full_name }}:${{ steps.meta.outputs.version }} build
- name: Publish Docker image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name == 'release' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
105 changes: 0 additions & 105 deletions .github/workflows/publish.yml

This file was deleted.

0 comments on commit 0f74615

Please sign in to comment.