indentation #81
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
name: Image Builder | |
on: | |
push: | |
# Build and publish after updating the default branch | |
branches: | |
- main | |
paths-ignore: | |
- '.dockerignore' | |
- 'docs/*' | |
- 'LICENSE' | |
- 'README.md' | |
- 'example/*' | |
pull_request: | |
# Build, but don't push on pull requests | |
jobs: | |
# Build images and push them | |
build: | |
name: Build Docker image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build image | |
run: | | |
docker build \ | |
--tag=${{ github.repository }} \ | |
--tag=ghcr.io/${{ github.repository }} \ | |
. | |
- name: Push to Docker Hub | |
if: >- | |
github.event_name == 'push' && | |
github.repository == 'neurolibre/inara' | |
run: | | |
# Log into registry | |
echo "${{ secrets.DOCKER_HUB_TOKEN }}" | | |
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin | |
docker push ${{ github.repository }} | |
- name: Push to GitHub Container Registry | |
if: >- | |
github.event_name == 'push' && | |
github.repository == 'neurolibre/inara' | |
run: | | |
# Log into registry | |
echo "${{ secrets.GITHUB_TOKEN }}" | \ | |
docker login ghcr.io \ | |
-u ${{ github.actor }} \ | |
--password-stdin | |
docker push ghcr.io/${{ github.repository }} |