-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build functionality to
github-pages
executable (#798)
Add Publish to Docker Workflow
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Publish to Docker | ||
on: | ||
push: | ||
branches: [ master ] | ||
tags: [ 'v*' ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
DOCKER_TAG_IMAGE: "ghcr.io/github/pages-gem" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get Docker Metadata | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.DOCKER_TAG_IMAGE }} | ||
|
||
- name: Build Docker Image | ||
run: | | ||
docker build -t ${{ steps.meta.outputs.tags }} -f Dockerfile . | ||
- name: Push to Container Registry | ||
if: github.event_name != 'pull_request' | ||
run: | | ||
echo ${{ secrets.GITHUB_TOKEN }} | docker login -u ${{ github.actor }} https://ghcr.io --password-stdin | ||
docker push ${{ steps.meta.outputs.tags }} | ||
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