Update docker.yml #8
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: Build and Publish the Docker Image | |
on: | |
push: | |
branches: | |
- master | |
env: | |
GITHUB_SHA: ${{ github.sha }} | |
IMAGE: images | |
REGISTRY_HOSTNAME: ghcr.io | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build Docker Image | |
run: | | |
docker build \ | |
-t "$REGISTRY_HOSTNAME"/cytoid/"$IMAGE" \ | |
--build-arg GITHUB_SHA="$GITHUB_SHA" \ | |
--build-arg GITHUB_REF="$GITHUB_REF" . | |
- name: Log in to registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
- name: Publish Docker Image | |
run: | | |
docker push "$REGISTRY_HOSTNAME"/cytoid/"$IMAGE" |