fix(sage-monorepo): pass GHCR credentials to the dev container in the… #6
Workflow file for this run
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: release | |
on: | |
push: | |
tags: | |
- 'agora/v*' | |
- 'openchallenges/v*' | |
env: | |
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
DOCKER_USERNAME: ${{ github.actor }} | |
PRODUCT: '' | |
VERSION: '' | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04-4core-16GBRAM-150GBSSD | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Extract product and version from Git tag | |
run: | | |
# Extract the product name (part before the first slash) and version (part after the first slash) | |
PRODUCT=$(echo "${GITHUB_REF#refs/tags/}" | cut -d'/' -f1) | |
VERSION=$(echo "${GITHUB_REF#refs/tags/}" | cut -d'/v' -f2) | |
# Output extracted values for the rest of the job | |
echo "PRODUCT=${PRODUCT}" >> $GITHUB_ENV | |
echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
- name: Derive appropriate SHAs for base and head for `nx affected` commands | |
uses: nrwl/nx-set-shas@v4 | |
- name: Set up the dev container | |
uses: ./.github/actions/setup-dev-container | |
- name: Build the images of all the OC projects | |
run: | | |
devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \ | |
&& echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin ghcr.io \ | |
&& export VERSION=${{ env.VERSION }} \ | |
&& nx build-image ${{ env.PRODUCT }}-apex --configuration=ci" |