RLS 0.2.0 #1
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: | |
- "*" | |
env: | |
DOCKER_REGISTRY: ghcr.io | |
DOCKER_IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: Install release dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
- name: Build and publish package | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_STACUTILS_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_STACUTILS_PASSWORD }} | |
run: | | |
scripts/publish | |
docker: | |
name: docker | |
permissions: | |
contents: read | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- | |
name: Checkout | |
uses: actions/checkout@v2 | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.DOCKER_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Source build args | |
run: | | |
source ./docker_env | |
STACTOOLS_VERSION=$(python scripts/stactools-version.py) | |
echo "stactools_version=$STACTOOLS_VERSION" >> $GITHUB_ENV | |
echo "docker_workdir=$DOCKER_WORKDIR" >> $GITHUB_ENV | |
echo "docker_namespace_package_dir=$DOCKER_NAMESPACE_PACKAGE_DIR" >> $GITHUB_ENV | |
- name: Run rename script if in the template repo | |
run: | | |
if [[ "$GITHUB_REPOSITORY" == */template ]]; then | |
scripts/rename | |
fi | |
- | |
name: Docker meta main | |
id: meta-main | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }} | |
flavor: | | |
latest=true | |
tags: | | |
type=pep440,pattern={{version}} | |
- | |
name: Build and push main | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: docker/Dockerfile | |
build-args: | | |
STACTOOLS_VERSION=${{ env.stactools_version }} | |
DOCKER_WORKDIR=${{ env.docker_workdir }} | |
DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }} | |
push: true | |
tags: ${{ steps.meta-main.outputs.tags }} | |
labels: ${{ steps.meta-main.outputs.labels }} | |
- | |
name: Docker meta dev | |
id: meta-dev | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }} | |
flavor: | | |
latest=true | |
suffix=-dev,onlatest=true | |
tags: | | |
type=pep440,pattern={{version}} | |
- | |
name: Build and push dev | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: docker/Dockerfile-dev | |
build-args: | | |
STACTOOLS_VERSION=${{ env.stactools_version }} | |
DOCKER_WORKDIR=${{ env.docker_workdir }} | |
DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }} | |
push: true | |
tags: ${{ steps.meta-dev.outputs.tags }} | |
labels: ${{ steps.meta-dev.outputs.labels }} |