-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs/, .github/workflow/infradocs.yml: improve CI
- Loading branch information
1 parent
fe104ec
commit 5c55c55
Showing
2 changed files
with
42 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,63 @@ | ||
name: infradocs | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- docs/** | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'docs/**' | ||
- docs/** | ||
|
||
jobs: | ||
main: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Checkout repo | ||
uses: classabbyamp/treeless-checkout-action@v1 | ||
|
||
- name: Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
submodules: false | ||
images: | | ||
ghcr.io/${{ github.repository_owner }}/infradocs | ||
tags: | | ||
type=sha,prefix= | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
flavor: latest=false | ||
labels: | | ||
org.opencontainers.image.authors=Void Linux team and contributors | ||
org.opencontainers.image.url=https://voidlinux.org | ||
org.opencontainers.image.documentation=https://infradocs.voidlinux.org | ||
org.opencontainers.image.source=https://github.com/${{ github.repository }} | ||
org.opencontainers.image.vendor=Void Linux | ||
org.opencontainers.image.title=Void Linux infrastructure documentation | ||
org.opencontainers.image.description=infrastructure documentation image for Void Linux | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to GCHR | ||
uses: docker/login-action@v1 | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: void-robot | ||
password: ${{ secrets.CR_PAT }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
tags: "ghcr.io/void-linux/infradocs:${{github.sha}}" | ||
context: docs | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 |
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