Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
202 changes: 101 additions & 101 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
name: Planetary Computer APIs CI/CD

on:
push:
branches: [main]
tags: ["*"]

permissions:
id-token: write
contents: read

jobs:
build_and_publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get Most Recent Tag
id: most-recent-tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"

- name: Log in with Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.SECURE_AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.SECURE_AZURE_TENANT_ID }}
subscription-id: ${{ secrets.SECURE_AZURE_SUBSCRIPTION_ID }}

- name: Set Azurite Default Key
run: |
echo "AZURITE_ACCOUNT_KEY=${{ secrets.AZURITE_ACCOUNT_KEY }}" >> $GITHUB_ENV
echo "Using Azurite default key: $AZURITE_ACCOUNT_KEY"

- name: Authenticate
run: ./scripts/ciauthenticate

- name: Run cibuild
run: ./scripts/cibuild

- name: Publish Image
id: publish_image
run: |
case "${GITHUB_REF}" in
*tags*)
tag=${GITHUB_REF/refs\/tags\//}
echo "tag=${tag}" >> $GITHUB_OUTPUT
./scripts/cipublish --acr pccomponents --tag ${tag}
;;
*)
echo "Publishing to pccomponentstest as latest"
echo "tag=latest" >> $GITHUB_OUTPUT
./scripts/cipublish --acr pccomponentstest --tag latest
echo "Also publishing to pccomponents ACR with unique tag"
./scripts/cipublish --acr pccomponents --tag ${{ steps.most-recent-tag.outputs.tag }}.${{ github.run_number }}
;;
esac

outputs:
image_tag: ${{ steps.publish_image.outputs.tag }}

deploy:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- build_and_publish
steps:
- uses: actions/checkout@v3

- name: Log in with Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.SECURE_AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.SECURE_AZURE_TENANT_ID }}
subscription-id: ${{ secrets.SECURE_AZURE_SUBSCRIPTION_ID }}

- name: Get image tag
id: get_image_tag
if: ${{ github.base_ref }}
run:
case "${GITHUB_REF}" in
*tags*)
echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
;;
*)
echo "tag=latest" >> $GITHUB_OUTPUT
;;
esac

- name: Deploy
run: ./scripts/cideploy
env:
IMAGE_TAG: ${{needs.build_and_publish.outputs.image_tag}}
ENVIRONMENT: staging
ARM_CLIENT_ID: ${{ secrets.SECURE_AZURE_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.SECURE_AZURE_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.SECURE_AZURE_TENANT_ID }}
ARM_USE_OIDC: true
# name: Planetary Computer APIs CI/CD
#
# on:
# push:
# branches: [main]
# tags: ["*"]
#
# permissions:
# id-token: write
# contents: read
#
# jobs:
# build_and_publish:
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
#
# - name: Get Most Recent Tag
# id: most-recent-tag
# uses: "WyriHaximus/github-action-get-previous-tag@v1"
#
# - name: Log in with Azure
# uses: azure/login@v1
# with:
# client-id: ${{ secrets.SECURE_AZURE_CLIENT_ID }}
# tenant-id: ${{ secrets.SECURE_AZURE_TENANT_ID }}
# subscription-id: ${{ secrets.SECURE_AZURE_SUBSCRIPTION_ID }}
#
# - name: Set Azurite Default Key
# run: |
# echo "AZURITE_ACCOUNT_KEY=${{ secrets.AZURITE_ACCOUNT_KEY }}" >> $GITHUB_ENV
# echo "Using Azurite default key: $AZURITE_ACCOUNT_KEY"
#
# - name: Authenticate
# run: ./scripts/ciauthenticate
#
# - name: Run cibuild
# run: ./scripts/cibuild
#
# - name: Publish Image
# id: publish_image
# run: |
# case "${GITHUB_REF}" in
# *tags*)
# tag=${GITHUB_REF/refs\/tags\//}
# echo "tag=${tag}" >> $GITHUB_OUTPUT
# ./scripts/cipublish --acr pccomponents --tag ${tag}
# ;;
# *)
# echo "Publishing to pccomponentstest as latest"
# echo "tag=latest" >> $GITHUB_OUTPUT
# ./scripts/cipublish --acr pccomponentstest --tag latest
# echo "Also publishing to pccomponents ACR with unique tag"
# ./scripts/cipublish --acr pccomponents --tag ${{ steps.most-recent-tag.outputs.tag }}.${{ github.run_number }}
# ;;
# esac
#
# outputs:
# image_tag: ${{ steps.publish_image.outputs.tag }}
#
# deploy:
# runs-on: ubuntu-latest
# if: ${{ github.ref == 'refs/heads/main' }}
# needs:
# - build_and_publish
# steps:
# - uses: actions/checkout@v3
#
# - name: Log in with Azure
# uses: azure/login@v1
# with:
# client-id: ${{ secrets.SECURE_AZURE_CLIENT_ID }}
# tenant-id: ${{ secrets.SECURE_AZURE_TENANT_ID }}
# subscription-id: ${{ secrets.SECURE_AZURE_SUBSCRIPTION_ID }}
#
# - name: Get image tag
# id: get_image_tag
# if: ${{ github.base_ref }}
# run:
# case "${GITHUB_REF}" in
# *tags*)
# echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
# ;;
# *)
# echo "tag=latest" >> $GITHUB_OUTPUT
# ;;
# esac
#
# - name: Deploy
# run: ./scripts/cideploy
# env:
# IMAGE_TAG: ${{needs.build_and_publish.outputs.image_tag}}
# ENVIRONMENT: staging
# ARM_CLIENT_ID: ${{ secrets.SECURE_AZURE_CLIENT_ID }}
# ARM_SUBSCRIPTION_ID: ${{ secrets.SECURE_AZURE_SUBSCRIPTION_ID }}
# ARM_TENANT_ID: ${{ secrets.SECURE_AZURE_TENANT_ID }}
# ARM_USE_OIDC: true
62 changes: 31 additions & 31 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: Planetary Computer APIs PR CI

on:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Run cibuild
run: ./scripts/cibuild
env:
AZURITE_ACCOUNT_KEY: ${{ secrets.AZURITE_ACCOUNT_KEY }}

validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.13" # stac-api-validator requires >= 3.10
cache: "pip"

- name: API Validator
run: ./scripts/validate
env:
AZURITE_ACCOUNT_KEY: ${{ secrets.AZURITE_ACCOUNT_KEY }}
# name: Planetary Computer APIs PR CI
#
# on:
# pull_request:
# branches: [main]
#
# jobs:
# build:
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v3
#
# - name: Run cibuild
# run: ./scripts/cibuild
# env:
# AZURITE_ACCOUNT_KEY: ${{ secrets.AZURITE_ACCOUNT_KEY }}
#
# validate:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v5
# - uses: actions/setup-python@v6
# with:
# python-version: "3.13" # stac-api-validator requires >= 3.10
# cache: "pip"
#
# - name: API Validator
# run: ./scripts/validate
# env:
# AZURITE_ACCOUNT_KEY: ${{ secrets.AZURITE_ACCOUNT_KEY }}
84 changes: 42 additions & 42 deletions .github/workflows/publish-charts-dev.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: Publish charts (dev)

on:
push:
branches: [main]
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-20.04
permissions:
contents: write

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags

- name: "Get Previous tag"
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1.2.2"
with:
fallback: 2022.2.0

- name: "Get next minor version"
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previoustag.outputs.tag }}

- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
charts_dir: "deployment/helm/published"
linting: "off"
helm_version: 3.5.4
chart_version: ${{steps.semvers.outputs.minor}}-dev
# name: Publish charts (dev)
#
# on:
# push:
# branches: [main]
# workflow_dispatch:
#
# defaults:
# run:
# shell: bash
#
# jobs:
# build:
# runs-on: ubuntu-20.04
# permissions:
# contents: write
#
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
#
# - name: "Get Previous tag"
# id: previoustag
# uses: "WyriHaximus/github-action-get-previous-tag@v1.2.2"
# with:
# fallback: 2022.2.0
#
# - name: "Get next minor version"
# id: semvers
# uses: "WyriHaximus/github-action-next-semvers@v1"
# with:
# version: ${{ steps.previoustag.outputs.tag }}
#
# - name: Publish Helm charts
# uses: stefanprodan/helm-gh-pages@master
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# charts_dir: "deployment/helm/published"
# linting: "off"
# helm_version: 3.5.4
# chart_version: ${{steps.semvers.outputs.minor}}-dev
Loading
Loading