feat: Add org/product breadcrumbs to challenge creation and improve o… #436
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: Deploy to Staging | |
concurrency: deploy_to_staging | |
on: | |
push: | |
branches: [ "main" ] | |
env: | |
STAGING_ID: cc67ac7f-d41b-4a9c-a2ce-37f322690cb8 | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Update the project version | |
run: | | |
OLD_VERSION=$(python -c 'import version; print(version.version)') | |
pip install python-semantic-release==9.4.1 && python -m semantic_release version --no-changelog | |
NEW_VERSION=$(python -c 'import version; print(version.version)') | |
if [[ "$OLD_VERSION" == "$NEW_VERSION" ]]; then | |
echo "No new version generated, can't deploy" | |
exit 1 | |
fi | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Build the Docker image | |
run: | | |
export VERSION=$(python -c 'import version; print(version.version)') | |
docker build . --file Dockerfile --tag registry.digitalocean.com/openunited/core:$VERSION | |
- name: Login to registry | |
run: doctl registry login --expiry-seconds 600 | |
- name: Push to DigitalOcean | |
run: docker push -a registry.digitalocean.com/openunited/core | |
- name: Fetch current spec file | |
run: doctl apps spec get $STAGING_ID > spec.yaml | |
- name: Update image tag | |
run: | | |
export VERSION=$(python -c 'import version; print(version.version)') | |
sed -i "s/\(.*tag: \).*/\1$VERSION/" spec.yaml | |
- name: Update the environment | |
run: doctl apps update $STAGING_ID --spec spec.yaml |