fix ghcr login in workflows #17
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: Docker Nightly | |
on: | |
push: | |
# Publish `master` as Docker `latest` image. | |
branches: | |
- main | |
- master | |
env: | |
IMAGE_NAME: enoarkime | |
jobs: | |
# Push image to GitHub Packages. | |
push: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Log into GitHub Container Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Push image to GitHub Container Registry | |
run: | | |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:nightly | |
# Change all uppercase to lowercase | |
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
docker image build -t $IMAGE_ID . | |
docker image push $IMAGE_ID |