Skip to content

Commit

Permalink
use ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
v-chen_data committed Oct 19, 2024
1 parent 6e87a5d commit 8524a4e
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
- name: Checkout source
uses: actions/checkout@v3

- name: Setup QEMU
uses: docker/setup-qemu-action@v2

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

Expand All @@ -37,33 +40,26 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Define Docker tags
- name: Login to GHCR
uses: docker/login-action@v2
with:
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
registry: ghcr.io

- name: Define Image Tags
id: define-tags
run: |
BRANCH_NAME="${{ github.ref_name }}"
TAG_NAME=$(echo "${BRANCH_NAME}" | sed 's/\//_/g')
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
echo "DOCKER_TAG=mosaicml/llm-foundry:test-release_${TAG_NAME}${{matrix.aws_extension}}" >> $GITHUB_ENV
- name: Calculate Docker Image Variables
- name: Define Image Cache
run: |
set -euxo pipefail
###################
# Calculate the image cache
###################
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "Triggered by pull_request event."
STAGING_REPO="mosaicml/ci-staging"
IMAGE_CACHE="${STAGING_REPO}:${{matrix.name}}-buildcache"
else
# Triggered by push or workflow_dispatch event
echo "Triggered by ${{ github.event_name }} event, releasing to prod"
PROD_REPO="mosaicml/llm-foundry"
IMAGE_CACHE="${PROD_REPO}:${{matrix.name}}-buildcache"
fi
PROD_REPO="mosaicml/llm-foundry"
IMAGE_CACHE="${PROD_REPO}:${{matrix.name}}-buildcache"
echo "IMAGE_CACHE=${IMAGE_CACHE}" >> ${GITHUB_ENV}
- name: Build and push Docker image
Expand Down

0 comments on commit 8524a4e

Please sign in to comment.