Migrate to GHCR

This commit is contained in:
Sidharth Vinod
2021-06-05 00:27:41 +05:30
committed by GitHub
parent 28181f7872
commit 3097161aa8
+6 -7
View File
@@ -10,15 +10,16 @@ on:
tags:
- v*
# Run tests for any PRs.
# Run tests for all PRs to master and develop.
pull_request:
branches:
- master
- develop
env:
IMAGE_NAME: mermaid-live-editor
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest
@@ -29,8 +30,6 @@ jobs:
run: |
docker build . --file Dockerfile
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
# Ensure test job passes before pushing image.
needs: test
@@ -45,11 +44,11 @@ jobs:
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')